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:
- 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.
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 | |||
Id | string | Yes | The ID of the custom 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 for pushing the event. Valid values:
| BACKOFFRETRY |
DeadLetterQueue | object | No | The dead-letter queue. Events that are not processed or whose maximum retries have been exceeded are written to the dead-letter queue. The dead-letter queue feature supports the following queue types: Message Queue for Apache RocketMQ, Message Service, Message Queue for Apache Kafka, and event bus. | |
Arn | string | No | The Alibaba Cloud Resource Name (ARN) of the dead-letter queue. Events that are not processed or whose maximum retries have been 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 | |||
ResourceKey | string | No | The resource parameter of the event target. For more information,see Event target parameters. | body |
Form | string | No | The method that is used to deliver events to the event target. For more information,see Event target parameters. | TEMPLATE |
Value | string | No | The value of the event target parameter. | {\"key\"=\"value\"} |
Template | string | No | The template based on which events are delivered to the event target. | The value of ${key} is ${value}! |
Response parameters
Examples
Sample success responses
JSON
format
{
"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 |