All Products
Search
Document Center

EventBridge:ListRules

Last Updated:Sep 15, 2025

Queries all rules of an event bus.

Operation description

You can call this API operation to query all rules of an event bus.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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:ListRulesget
*Rule
acs:eventbridge:{#regionId}:{#accountId}:eventbus/{#EventBusName}/rule/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RuleNamePrefixstringNo

The prefix of the rule name.

test
LimitintegerNo

The maximum number of entries to be returned in a single call. You can use this parameter and the NextToken parameter to implement paging. A maximum of 100 entries can be returned in a single call.

50
NextTokenstringNo

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

1000
EventBusNamestringYes

The name of the event bus.

default

Response parameters

ParameterTypeDescriptionExample
object
Messagestring

The error message that is returned if the request failed.

Specified parameter Limit is not valid.
RequestIdstring

The request ID.

C7043799-F4DA-5290-9249-97C359876D97
Dataobject

The returned data.

NextTokenstring

If excess return values exist, this parameter is returned.

1000
Totalinteger

The total number of entries.

6
Rulesarray<object>

The event rules.

Rulesobject

The event rule.

DetailMapobject

The details of the event rule.

Statusstring

The status of the event rule. Valid values:

  • ENABLE (default)
  • DISABLE
ENABLE
EventBusNamestring

The name of the event bus.

demo
RuleARNstring

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

acs:eventbridge:cn-hangzhou:123456789098****:eventbus/default/rule/myRule3
Descriptionstring

The rule description.

demo
Targetsarray<object>

The event targets.

Targetsobject

The event target.

Typestring

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

acs.mns.queue
Endpointstring

The endpoint of the event target.

acs:mns:cn-hangzhou:123456789098****:queues/myqueue
Idstring

The ID of the custom event target.

177
PushSelectorstring

The transformer that is used to push events.

MATCHED_EVENT
ErrorsTolerancestring

The fault tolerance policy. Valid values:

  • 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 prohibited. 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
FilterPatternstring

The event pattern, in JSON format. Valid values:

  • stringEqual: Up to five expressions in the map data structure can be specified in each field.
  • stringExpression: Up to five expressions in the map data structure can be specified in each field.
{\"source\":[\"acs.oss\"],\"type\":[\"oss:BucketQueried:GetBucketStat\"]}
CreatedTimestamplong

The creation timestamp.

1607071602000
RuleNamestring

The name of the event rule.

tf-testacc-rule
Codestring

The response code.

  • Success: The request was successful.
  • Other codes: The request failed. For more information about error codes, see Error codes.
Success
Successboolean

Indicates whether the request was successful. Valid values: true and false.

true

Examples

Sample success responses

JSONformat

{
  "Message": "Specified parameter Limit is not valid.",
  "RequestId": "C7043799-F4DA-5290-9249-97C359876D97",
  "Data": {
    "NextToken": 1000,
    "Total": 6,
    "Rules": [
      {
        "DetailMap": {
          "test": "test",
          "test2": 1
        },
        "Status": "ENABLE",
        "EventBusName": "demo",
        "RuleARN": "acs:eventbridge:cn-hangzhou:123456789098****:eventbus/default/rule/myRule3",
        "Description": "demo",
        "Targets": [
          {
            "Type": "acs.mns.queue\n",
            "Endpoint": "acs:mns:cn-hangzhou:123456789098****:queues/myqueue",
            "Id": 177,
            "PushSelector": "MATCHED_EVENT",
            "ErrorsTolerance": "ALL"
          }
        ],
        "FilterPattern": "{\\\"source\\\":[\\\"acs.oss\\\"],\\\"type\\\":[\\\"oss:BucketQueried:GetBucketStat\\\"]}\n",
        "CreatedTimestamp": 1607071602000,
        "RuleName": "tf-testacc-rule"
      }
    ]
  },
  "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 changedView Change Details