All Products
Search
Document Center

EventBridge:GetRule

Last Updated:Dec 04, 2024

Queries the details of an event rule.

Operation description

You can call this API operation to query the details 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:GetRuleget
*Rule
acs:eventbridge:{#regionId}:{#accountId}:eventbus/{#EventBusName}/rule/{#RuleName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
EventBusNamestringYes

The name of the event bus.

default
RuleNamestringYes

The name of the event rule.

ram-changes

Response parameters

ParameterTypeDescriptionExample
object
Messagestring

The returned error message.

The event rule not existed!
RequestIdstring

The request ID.

2BC1857D-E633-5E79-B2C2-43EF5F7730D8
Dataobject

The returned parameters.

Statusstring

The status of the event rule. Valid values: ENABLE (default): The event rule is enabled. DISABLE: The event rule is disabled.

ENABLE
EventBusNamestring

The name of the event bus.

Housekeeping-Bus
RuleARNstring

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

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

The description of the event rule.

test
Targetsarray<object>

The event targets.

Targetsobject
DetailMapobject

The information about 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
ParamListarray<object>

The parameters that are configured for the event target.

ParamListobject
Valuestring

The event target.

{\"key\"=\"value\"}
Templatestring

The template based on which events are delivered to the event target.

The value of ${key} is ${value}!
Formstring

The format that is used by the event target parameter. For more information, see Limits .

TEMPLATE
ResourceKeystring

The resource key of the event target. For more information, see Limits .

body
PushSelectorstring

The transformer that is used to push events.

MATCHED_EVENT
Idstring

The ID of the event target.

1
DeadLetterQueueobject

The dead-letter queue.

Arnstring

The Alibaba Cloud Resource Name (ARN) of the dead-letter queue.

acs:eventbridge:cn-hangzhou:164901546557****:eventbus/my-event-bus/eventsource/myRocketMQ.source
PushRetryStrategystring

The retry policy that is used to push failed events. Valid values: BACKOFF_RETRY and EXPONENTIAL_DECAY_RETRY. BACKOFF_RETRY: backoff retry. A failed event can be retried up to three times. The interval between two consecutive retries is a random value between 10 seconds and 20 seconds. EXPONENTIAL_DECAY_RETRY: exponential decay retry. A failed event can be retried up to 176 times. The interval between two consecutive retries exponentially increases to a maximum of 512 seconds. The total retry time is 1 day. The specific retry intervals are 1, 2, 4, 8, 16, 32, 64, 128, 256, and 512 seconds. The interval of 512 seconds is used for 167 retries.

BACKOFF_RETRY
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
FilterPatternstring

The event pattern, in JSON format. Valid values: stringEqual and stringExpression. You can specify up to five expressions in the map data structure in each field.

You can specify up to five expressions in the map data structure in each field.

{\"source\":[\"acs.oss\"],\"type\":[\"oss:BucketQueried:GetBucketStat\"]}
CreatedTimestamplong

The timestamp that indicates when the event rule was created.

1607071602000
RuleNamestring

The name of the event rule.

ramrolechange-fc
Codestring

The response code. The value Success indicates that the request is successful. Other values indicate that the request failed. For a list of error codes, see Error codes.

Success
Successboolean

Indicates whether the operation is successful. If the operation is successful, the value true is returned.

true

Examples

Sample success responses

JSONformat

{
  "Message": "The event rule not existed!",
  "RequestId": "2BC1857D-E633-5E79-B2C2-43EF5F7730D8",
  "Data": {
    "Status": "ENABLE",
    "EventBusName": "Housekeeping-Bus",
    "RuleARN": "acs:eventbridge:cn-hangzhou:123456789098****:eventbus/default/rule/myRule3",
    "Description": "test",
    "Targets": [
      {
        "DetailMap": {
          "test": "test",
          "test2": 1
        },
        "Type": "acs.mns.queue",
        "Endpoint": "acs:mns:cn-hangzhou:123456789098****:queues/myqueue",
        "ParamList": [
          {
            "Value": "{\\\"key\\\"=\\\"value\\\"}",
            "Template": "The value of ${key} is ${value}!",
            "Form": "TEMPLATE",
            "ResourceKey": "body"
          }
        ],
        "PushSelector": "MATCHED_EVENT",
        "Id": "1",
        "DeadLetterQueue": {
          "Arn": "acs:eventbridge:cn-hangzhou:164901546557****:eventbus/my-event-bus/eventsource/myRocketMQ.source"
        },
        "PushRetryStrategy": "BACKOFF_RETRY",
        "ConcurrentConfig": {
          "Concurrency": 0
        },
        "ErrorsTolerance": "ALL"
      }
    ],
    "FilterPattern": "{\\\"source\\\":[\\\"acs.oss\\\"],\\\"type\\\":[\\\"oss:BucketQueried:GetBucketStat\\\"]}",
    "CreatedTimestamp": 1607071602000,
    "RuleName": "ramrolechange-fc"
  },
  "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