ListRules

更新时间:
复制 MD 格式

Queries all event rules. You can use the Limit and NextToken parameters to implement paging.

URI

/openapi/listRules

Request parameters

ParameterTypeRequiredExampleDescription
EventBusNameStringYesdefaultFor more information, see Limits.
RuleNamePrefixStringYesmyThe name of the event rule. For more information, see Limits.
LimitStringNo10The maximum number of entries to be returned in a call. You can use this parameter and the NextToken parameter to implement paging.
Note A maximum of 100 entries can be returned in a call.
NextTokenStringNo5If you configure the Limit parameter and excess return values exist, this parameter is returned.

Response parameters

ParameterTypeExampleDescription
NextTokenString5The offset for the next paging request. If excess data over the specified value of the Limit parameter is available for the next paging request, this parameter is returned.
RulesList<Rule>The event rules returned.
EventBusNameStringdefaultThe name of the event bus.
RuleARNStringacs:eventbridge:cn-hangzhou:123456789098****:eventbus/default/rule/myRule1The Alibaba Cloud Resource Name (ARN) of the event rule. The ARN is used for authorization.
RuleNameStringmyRule1The name of the event rule.
StatusStringENABLEThe status of the event rule. Valid values:
  • ENABLE: The event rule is enabled. It is the default state of the event rule.
  • DISABLE: The event rule is disabled.
FilterPatternString
{\"source\":[\"acs.oss\"],\"type\":[\"oss:ObjectCreated:UploadPart\"]}
The event pattern, in the JSON format. Valid values:
  • stringEqual pattern
  • stringExpression pattern

    Each field can have a maximum of five expressions in the map data structure.

Each field can have a maximum of five expressions in the map data structure.

TargetsList<Target>The event target to which events are delivered.
IdStringtarget1The custom ID of the event target.
TypeStringhttpThe type of the event target.
EndpointStringhttp://www.example.comThe endpoint of the event target.
PushRetryStrategyStringBACKOFF_RETRYThe retry policy that is used to push the event. Valid values:
  • BACKOFF_RETRY: backoff retry. The request can be retried up to three times. The interval between two consecutive retries is a random value between 10 and 20 seconds.
  • EXPONENTIAL_DECAY_RETRY: exponential decay retry. The request can be retried up to 176 times. The interval between two consecutive retries exponentially increases to 512 seconds, and the total retry time is one day. The specific retry intervals are 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, ..., and 512 seconds, including a maximum of one hundred and sixty-seven 512 seconds in total.
ParamListList<Param>The parameters that the event passes.
resourceKeyStringbodyThe resource key of the transformed event.For more information, see Event target parameters.
formStringTEMPLATEThe transformation method.For more information, see Event target parameters.
valueString
{\"key\"=\"value\"}
The event value to be transformed.
templateStringThe value of ${key} is ${value}!The format of the template.

Examples

Sample requests

POST /openapi/listRules HTTP/1.1
Host: 123456789098****.eventbridge.cn-hangzhou.aliyuncs.com
Date: Sat, 18 Apr 2020 05:30:41 GMT
x-eventbridge-version: 2020-04-01
Authorization: acs vZ3VL0SuJdHi****:Jo2PbTj****zYAYoYslKLvWzg=
Content-Type: application/json;charset=UTF-8
Content-Length: 26

{
    "EventBusName":"default",
    "RuleNamePrefix":"my",
    "Limit":"10",
    "NextToken":"5"
}

Sample success response

HTTP/1.1 200 OK
Server: AliyunEventBridge
Connection: keep-alive
Content-Type: application/json;charset=utf-8
Content-Length: 79
x-eventbridge-request-id: 5E9A9081333245F1D800****
Date: Sat, 18 Apr 2020 05:30:41 GMT

{
    "NextToken":"5",
    "Rules":[
        {
            "EventBusName":"default",
            "RuleARN":"acs:eventbridge:cn-hangzhou:123456789098****:eventbus/default/rule/myRule1",
            "RuleName":"myRule1",
            "status":"ENABLE",
            "FilterPattern":"{\"source\":[\"acs.oss\"],\"type\":[\"oss:ObjectCreated:UploadPart\"]}",
            "Targets":[
                {
                    "Id":"target1",
                    "Type":"http",
                    "Endpoint":"http://www.example.com",
                    "PushRetryStrategy":"EXPONENTIAL_DECAY_RETRY"
                }
            ],
            "ResourceKeys":[
                {
                    "form":"CONSTANT",
                    "resourceKey":"url"
                },
                {
                    "form":"TEMPLATE",
                    "resourceKey":"body"
                }
            ]
        }
    ]
}