GetRule

Updated at:

Queries the details of an event rule.

Operation description

Retrieves the details of an event rule.

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:GetRule

get

*Rule

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

None None

Request parameters

Parameter

Type

Required

Description

Example

EventBusName

string

Yes

The name of the event bus.

default

RuleName

string

Yes

The name of the rule.

ram-changes

Response elements

Element

Type

Description

Example

object

Message

string

The error message.

The event rule not existed!

RequestId

string

The unique identifier generated by Alibaba Cloud for the request.

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

Data

object

The returned result.

Status

string

The status of the rule. Valid values:

  • ENABLE: The rule is enabled. This is the default status.

  • DISABLE: The rule is disabled.

ENABLE

EventBusName

string

The name of the event bus.

Housekeeping-Bus

RuleARN

string

The ARN of the rule.

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

Description

string

The description of the rule.

test

Targets

array<object>

The list of event targets.

array<object>

The event target.

DetailMap

object

The detailed information.

Type

string

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

acs.mns.queue

Endpoint

string

The endpoint URL for delivery.

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

ParamList

array<object>

The list of parameters for the event target.

object

The parameter of the event target.

Value

string

The value of the event target parameter.

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

Template

string

The style of the event target parameter template.

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

Form

string

The format of the event target parameter. For more information, see Limits.

TEMPLATE

ResourceKey

string

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

body

PushSelector

string

The push selector.

PARAM_TRANSFORMER

Id

string

The ID of the custom event target.

Mlm123456JHd2RsRoKw

DeadLetterQueue

object

The dead-letter queue.

Arn

string

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

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

Network

string

The network type of the dead-letter queue.

PrivateNetwork

VpcId

string

The ID of the VPC where the dead-letter queue resides.

vpc-2z****

VSwitchIds

string

The vSwitch IDs.

vsw-m5e****

SecurityGroupId

string

The security group ID.

sg-2v****

PushRetryStrategy

string

The push retry policy. Valid values:

  • BACKOFF_RETRY: The backoff retry policy. The system retries three times. The interval between two consecutive retries is a random value between 10 seconds and 20 seconds.

  • EXPONENTIAL_DECAY_RETRY: The exponential decay retry. The system retries 176 times. The interval between two consecutive retries exponentially increments up to 512 seconds. The total retry time is one day. The specific intervals are 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, and 512 seconds (167 intervals of 512 seconds).

BACKOFF_RETRY

ConcurrentConfig

object

The concurrency configuration.

Concurrency

integer

The concurrency.

2

ErrorsTolerance

string

The fault tolerance strategy. Valid values:

  • ALL: Allows fault tolerance. When an exception occurs, the execution is not blocked. If the retry strategy is exhausted, the message is delivered to the dead-letter queue or discarded based on the configuration.

  • NONE: Disables fault tolerance. When an exception occurs and the retry strategy is exhausted, the execution is blocked.

ALL

FilterPattern

string

The event pattern in JSON format. The following rules apply:

  • stringEqual mode: A maximum of five expressions are allowed for each field (map structure).

  • stringExpression mode: A maximum of five expressions are allowed for each field (map structure).

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

CreatedTimestamp

integer

The creation timestamp.

1607071602000

RuleName

string

The name of the rule.

ramrolechange-fc

Code

string

The response code. Valid values:

  • Success: The request is successful.

  • Other values: The error code. For more information, see Error codes.

Success

Success

boolean

Indicates whether the request is successful.

true

Examples

Success response

JSON format

{
  "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": "PARAM_TRANSFORMER",
        "Id": "Mlm123456JHd2RsRoKw\n",
        "DeadLetterQueue": {
          "Arn": "acs:eventbridge:cn-hangzhou:164901546557****:eventbus/my-event-bus/eventsource/myRocketMQ.source",
          "Network": "PrivateNetwork",
          "VpcId": "vpc-2z****",
          "VSwitchIds": "vsw-m5e****",
          "SecurityGroupId": "sg-2v****"
        },
        "PushRetryStrategy": "BACKOFF_RETRY",
        "ConcurrentConfig": {
          "Concurrency": 2
        },
        "ErrorsTolerance": "ALL"
      }
    ],
    "FilterPattern": "{\\\"source\\\":[\\\"acs.oss\\\"],\\\"type\\\":[\\\"oss:BucketQueried:GetBucketStat\\\"]}",
    "CreatedTimestamp": 1607071602000,
    "RuleName": "ramrolechange-fc"
  },
  "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.