GetRule

Updated at:

The GetRule operation retrieves the details of an event rule.

URI

/openapi/getRule

Request parameters

NameTypeRequiredExampleDescription
EventBusNameStringYesdefaultThe name of the event bus. For more information, see Limits.
RuleNameStringYesmyRule3The name of the event rule. For more information, see Limits.

Response parameters

NameTypeExampleDescription
EventBusNameStringdefaultThe name of the event bus.
RuleARNStringacs:eventbridge:cn-hangzhou:123456789098****:eventbus/default/rule/myRule3The Alibaba Cloud Resource Name (ARN) of the rule.
RuleNameStringmyRule3The name of the event rule.
DescriptionStringtestThe description of the rule.
StatusStringENABLEThe status of the 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:BucketQueried:GetBucketStat\"]}
The event pattern in 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 destination.
IdString1The custom ID of the event target.
TypeStringacs.mns.queueTarget type.
EndpointStringacs:mns:cn-hangzhou:123456789098****:queues/myqueueThe URL of the delivery endpoint.
PushRetryStrategyStringBACKOFF_RETRYThe retry policy for pushing events. 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 for event delivery.
resourceKeyStringbodyThe resource parameter for the event transformation. For more information, see Event target parameters.
formStringTEMPLATEThe format of the event transformation. For more information, see Event target parameters.
valueString
{\"key\"=\"value\"}
The value of the event transformation.
templateStringThe value of ${key} is ${value}!The template style.

Examples

Sample request

POST /openapi/getRule 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",
    "RuleName":"myRule3"
}

Sample 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

{
    "EventBusName":"default",
    "Description":"test",
    "RuleARN":"acs:eventbridge:cn-hangzhou:123456789098****:eventbus/default/rule/myRule3",
    "RuleName":"myRule3",
    "Status":"ENABLE",
    "FilterPattern":"{\"source\":[\"acs.oss\"],\"type\":[\"oss:BucketQueried:GetBucketStat\"]}",
    "Targets":[
        {
            "Id":"1",
            "Type":"acs.mns.queue",
            "Endpoint":"acs:mns:cn-hangzhou:123456789098****:queues/myqueue",
            "PushRetryStrategy":"BACKOFF_RETRY",
            "ParamList":[
                {
                    "resourceKey":"queue",
                    "form":"CONSTANT",
                    "value":"myqueue"
                },
                {
                    "resourceKey":"body",
                    "form":"TEMPLATE",
                    "value":"{\"key\"=\"value\"}",
                    "template":"The value of ${key} is ${value}!"
                }
            ]
        }
    ]
}