Creates or updates event targets under a rule.
Operation description
You can call this API operation to create or update event targets under a rule.
Debugging
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:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis 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.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| eventbridge:PutTargets | update | *Rule acs:eventbridge:{#regionId}:{#accountId}:eventbus/{#EventBusName}/rule/{#RuleName} |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| EventBusName | string | Yes | The name of the event bus. | eventTest |
| RuleName | string | Yes | The name of the event rule. | ssr-send-to-vendor-test01 |
| Targets | array<object> | Yes | The event targets to be created or updated. For more information, see Limits . | |
| object | Yes | The event target to be created or updated. | ||
| Id | string | Yes | The ID of the event target. | Mlm123456JHd2RsRoKw |
| Type | string | Yes | The type of the event target. For more information, see Event target parameters. | acs.fc.function |
| Endpoint | string | No | The endpoint of the event target. | acs:fc:cn-hangzhou:123456789098****:services/guide.LATEST/functions/HelloFC |
| PushRetryStrategy | string | No | The retry policy to be used to push events. Valid values:
| BACKOFFRETRY |
| DeadLetterQueue | object | No | The dead-letter queue. Events that are not processed or whose maximum retries are exceeded are written to the dead-letter queue. You can use queues in ApsaraMQ for RocketMQ, Simple Message Queue (SMQ, formerly MNS), and ApsaraMQ for Kafka as dead-letter queues. You can also use event buses in EventBridge as dead-letter queues. | |
| Arn | string | No | The Alibaba Cloud Resource Name (ARN) of the dead-letter queue. Events that are not processed or whose maximum retries are exceeded are written to the dead-letter queue. | acs:mns:cn-hangzhou:123456789098****:/queues/deadletterqueue or acs:mq:cn-hangzhou:123456789098****:/instances/MQ_INST_123456789098****_BX8QbBPL/topic/deadlettertopic or acs:alikafka:cn-hangzhou:123456789098****:instance/alikafka_post-cn-123456/topic/deadlettertopic or acs:eventbridge:cn-hangzhou:123456789098****:eventbus/deadletterbus |
| ErrorsTolerance | string | No | The fault tolerance policy. Valid values:
| ALL |
| ParamList | array<object> | No | The parameters that are configured for the event target. | |
| object | No | The parameters that are configured for the event target. | ||
| ResourceKey | string | No | The resource key of the event target. For more information, see Event target parameters. | body |
| Form | string | No | The format of input parameters for the event target. For more information, see Event target parameters. | TEMPLATE |
| Value | string | No | The event target. | {\"key\"=\"value\"} |
| Template | string | No | The structure of the template for the event target. | The value of ${key} is ${value}! |
| ConcurrentConfig | object | No | The concurrency configuration. | |
| Concurrency | long | No | The concurrency. | 34 |
Response parameters
Examples
Sample success responses
JSONformat
{
"Message": "The event rule not existed!",
"RequestId": "6FB52207-7621-5292-BDF2-A17E2E984160\n",
"Data": {
"ErrorEntriesCount": 0,
"ErrorEntries": [
{
"ErrorMessage": "The id of event target is duplicate!",
"ErrorCode": "EventRuleTargetIdDuplicate",
"EntryId": "Mlm123456JHd2RsRoKw"
}
]
},
"Code": "Success",
"Success": true
}Error codes
| HTTP status code | Error code | Error message |
|---|---|---|
| 403 | ServiceNotEnable | Service not enable |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2024-09-25 | The Error code has changed | View Change Details |
