All Products
Search
Document Center

EventBridge:ListTargets

Last Updated:Dec 04, 2024

Queries all event targets of an event rule.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.

Targetsarray<object>

The event targets.

Targetsobject
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
ParamListarray<object>

The parameters that are configured for the event target.

ParamListobject
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
ErrorsTolerancestring

The fault tolerance policy. Valid values: ALL and NONE.

  • ALL: Fault tolerance is allowed. If an error occurs in an event, event processing is not blocked. If the event fails to be sent after the maximum number of retries specified by the retry policy is reached, the event is delivered to the dead-letter queue or discarded based on your configurations.
  • NONE: Fault tolerance is not allowed. If an error occurs in an event and the event fails to be sent after the maximum number of retries specified by the retry policy is reached, event processing is blocked.
ALL
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": "ALL",
        "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
2024-09-25The Error code has changed. The response structure of the API has changedView Change Details
2023-07-04The Error code has changed. The response structure of the API has changedView Change Details
2023-06-09API Description Update. The Error code has changedView Change Details