GetRule

Updated at:
Copy as MD

Retrieves the details of an event rule.

Operation description

Gets 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 request ID generated by Alibaba Cloud.

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

Data

object

The response data.

Status

string

The status of the rule. Valid values:

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

  • 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>

An event target.

DetailMap

object

The details of the event target.

Type

string

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

acs.mns.queue

Endpoint

string

The delivery endpoint for the event.

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

ParamList

array<object>

The list of parameters for the event target.

object

A parameter for the event target.

Value

string

The value of the event target parameter.

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

Template

string

The template of the event target parameter.

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 key of the event target. For more information, see Limits.

body

PushSelector

string

The push selector.

PARAM_TRANSFORMER

Id

string

The custom ID of the event target.

Mlm123456JHd2RsRoKw

DeadLetterQueue

object

The dead-letter queue.

Arn

string

The Alibaba Cloud Resource Name (ARN) of the 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.

VpcId

string

The VPC ID.

VSwitchIds

string

The vSwitch IDs.

SecurityGroupId

string

The security group ID.

PushRetryStrategy

string

The retry policy for pushing events. Valid values:

  • BACKOFF_RETRY: A backoff retry policy. The event is retried 3 times at a random interval between 10 and 20 seconds.

  • EXPONENTIAL_DECAY_RETRY: An exponential decay retry policy. The event is retried 176 times over one day. The retry interval starts at 1 second and exponentially increases to a maximum of 512 seconds. The specific retry intervals are 1, 2, 4, 8, 16, 32, 64, 128, 256, and then 512 for the remaining 167 retries.

BACKOFF_RETRY

ConcurrentConfig

object

The concurrency settings.

Concurrency

integer

The maximum number of concurrent pushes.

2

ErrorsTolerance

string

The fault tolerance policy. Valid values:

  • ALL: Enables fault tolerance. Errors do not block event delivery. If all retries fail, the system sends the event to the specified dead-letter queue or discards it.

  • NONE: Disables fault tolerance. If an error persists after all retries, the system blocks event delivery.

ALL

FilterPattern

string

The event pattern in JSON format. The following modes are supported:

  • stringEqual mode: In the map structure, each field can contain up to five expressions.

  • stringExpression mode: In the map structure, each field can contain up to five expressions.

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

CreatedTimestamp

integer

The creation timestamp of the rule.

1607071602000

RuleName

string

The name of the rule.

ramrolechange-fc

Code

string

The response code. Valid values:

  • Success: The request was successful.

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

Success

Success

boolean

Indicates whether the operation was successful. A value of true indicates success.

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": "",
          "VpcId": "",
          "VSwitchIds": "",
          "SecurityGroupId": ""
        },
        "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.