All Products
Search
Document Center

EventBridge:ListRules

Last Updated:Aug 28, 2026

Queries all rules of an event bus.

Operation description

Queries all rules of an event bus.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

eventbridge:ListRules

get

*Rule

acs:eventbridge:{#regionId}:{#accountId}:eventbus/{#EventBusName}/rule/*

None None

Request parameters

Parameter

Type

Required

Description

Example

RuleNamePrefix

string

No

The prefix of the rule name.

test

Limit

integer

No

The maximum number of entries per page. You can use this parameter together with NextToken to implement pagination. Maximum value: 100.

50

NextToken

string

No

The pagination token for the next page. If not all results are returned in a single request, this parameter is included in the response.

1000

EventBusName

string

Yes

The name of the event bus.

default

Response elements

Element

Type

Description

Example

object

Message

string

The error message returned if the request failed.

Specified parameter Limit is not valid.

RequestId

string

The request ID.

C7043799-F4DA-5290-9249-97C359876D97

Data

object

The returned data.

NextToken

string

The pagination token for the next page. If not all results are returned, this parameter is included in the response.

1000

Total

integer

The total number of entries.

6

Rules

array<object>

The event rules.

array<object>

The event rule.

DetailMap

object

The details of the event rule.

Status

string

The status of the event rule. Valid values:

  • ENABLE (default)

  • DISABLE

ENABLE

EventBusName

string

The name of the event bus.

demo

RuleARN

string

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

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

Description

string

The rule description.

demo

Targets

array<object>

The event targets.

object

The event target.

Type

string

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

acs.mns.queue

Endpoint

string

The endpoint of the event target.

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

Id

string

The ID of the custom event target.

177

PushSelector

string

The transformer used to push events.

MATCHED_EVENT

ErrorsTolerance

string

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 still fails after the maximum number of retries, it 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 still fails after the maximum number of retries, event processing is blocked.

ALL

FilterPattern

string

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\"]}

CreatedTimestamp

integer

The creation timestamp.

1607071602000

RuleName

string

The name of the event rule.

tf-testacc-rule

Code

string

The response code.

  • Success: The request was successful.

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

Success

Success

boolean

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

true

Examples

Success response

JSON format

{
  "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 code

Error code

Error message

Description

403 ServiceNotEnable Service not enable

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.