All Products
Search
Document Center

EventBridge:ListTargets

Last Updated:Mar 15, 2024

Queries all event targets of an event rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
eventbridge:ListTargetsList
  • Rule
    acs:eventbridge:{#regionId}:{#accountId}:eventbus/{#EventBusName}/rule/{#RuleName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
EventBusNamestringNo

The name of the event bus.

my-event-bus
LimitintegerNo

The maximum number of returned entries in a call.

10
RuleNamestringNo

The name of the event rule.

tf-testacc-rule
NextTokenstringNo

If you configure Limit and excess return values exist, this parameter is returned.

0
ArnstringNo

The Alibaba Cloud Resource Name (ARN) of the event rule.

acs:fc:cn-hangzhou:118609547428****:services/fc-connector.a1/functions/event

Response parameters

ParameterTypeDescriptionExample
object
Messagestring

The returned error message.

EventRuleNotExisted
RequestIdstring

The request ID.

5DAF96FB-A4B6-548C-B999-0BFDCB2261B9
Dataobject

The returned data.

Targetsobject []

The event targets.

Typestring

The type of the event target. For more information, see Event target parameters.

acs.fc.function
Endpointstring

The endpoint of the event target.

acs:fc:cn-hangzhou:123456789098****:services/guide.LATEST/functions/HelloFC
ParamListobject []

The parameters that are configured for the event target.

Valuestring

The value of the event target parameter.

{\"key\"=\"value\"}
Templatestring

The template that is used by the event target parameter.

The value of ${key} is ${value}!
Formstring

The format that is used by the event target parameter.

TEMPLATE
ResourceKeystring

The resource parameter of the event target.

body
Idstring

The ID of the event target.

1453
EventBusNamestring

The name of the event bus.

sls-beijing-one1-tf
RuleNamestring

The name of the event rule.

rule-uKAK2
NextTokenstring

If excess return values exist, this parameter is returned.

1
Totalinteger

The total number of entries.

18
Codestring

The returned response code. Valid values:

  • Success: The request is successful.
  • Other codes: The request failed. For a list of error codes, see Error codes.
Success
Successboolean

Indicates whether the request is successful. Valid values:

  • true
  • false
true

Examples

Sample success responses

JSONformat

{
  "Message": "EventRuleNotExisted",
  "RequestId": "5DAF96FB-A4B6-548C-B999-0BFDCB2261B9",
  "Data": {
    "Targets": [
      {
        "Type": "acs.fc.function ",
        "Endpoint": "acs:fc:cn-hangzhou:123456789098****:services/guide.LATEST/functions/HelloFC ",
        "ParamList": [
          {
            "Value": "{\\\"key\\\"=\\\"value\\\"}",
            "Template": "The value of ${key} is ${value}! ",
            "Form": "TEMPLATE",
            "ResourceKey": "body"
          }
        ],
        "ErrorsTolerance": "",
        "Id": "1453",
        "EventBusName": "sls-beijing-one1-tf",
        "RuleName": "rule-uKAK2"
      }
    ],
    "NextToken": "1",
    "Total": 18
  },
  "Code": "Success",
  "Success": true
}

Error codes

HTTP status codeError codeError message
403ServiceNotEnableService not enable

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-07-04The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 403
Output ParametersThe response structure of the API has changed.
2023-06-09API Description Update. The Error code has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    delete Error Codes: 403