Creates or updates event targets for a specified event rule.
Operation description
Creates or updates event targets for a specified event rule.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
eventbridge:PutTargets |
update |
*Rule
|
None | 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 list of event targets to create or update. For more information, see Limits. |
|
|
array<object> |
No |
The event target to create or update. |
||
| Id |
string |
Yes |
The custom 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 URL for delivery. |
acs:fc:cn-hangzhou:123456789098****:services/guide.LATEST/functions/HelloFC |
| PushRetryStrategy |
string |
No |
The retry policy for pushing events. Valid values:
|
BACKOFFRETRY |
| DeadLetterQueue |
object |
No |
The dead-letter queue. Events that are not processed or exceed the number of retries are written to the dead-letter queue. The dead-letter queue supports the following queue types: Message Queue for Apache RocketMQ, Simple Message Queue (formerly MNS), Message Queue for Apache Kafka, and EventBridge. |
|
| Arn |
string |
No |
The Alibaba Cloud Resource Name (ARN) of the dead-letter queue. Events that are not processed or exceed the number of retries 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 |
| Network |
string |
No |
||
| VpcId |
string |
No |
||
| VSwitchIds |
string |
No |
||
| SecurityGroupId |
string |
No |
||
| ErrorsTolerance |
string |
No |
The fault tolerance policy. Valid values:
|
ALL |
| ParamList |
array<object> |
No |
The parameters of the event target. |
|
|
object |
No |
The parameters of the event target. |
||
| ResourceKey |
string |
No |
The resource parameter of the event target. For more information, see Event target parameters. |
body |
| Form |
string |
No |
The format of the event target parameter. 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 of the event target parameter. |
The value of ${key} is ${value}! |
| ConcurrentConfig |
object |
No |
The concurrency control configuration. |
|
| Concurrency |
integer |
No |
The number of concurrent operations. |
34 |
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. |
6FB52207-7621-5292-BDF2-A17E2E984160 |
| Data |
object |
The returned result. |
|
| ErrorEntriesCount |
integer |
The number of event targets that failed to be processed. Valid values:
|
0 |
| ErrorEntries |
array<object> |
The information about the event targets that failed to be processed. |
|
|
object |
The information about the event targets that failed to be processed. |
||
| ErrorMessage |
string |
The details of the error. |
The id of event target is duplicate! |
| ErrorCode |
string |
The error code. |
EventRuleTargetIdDuplicate |
| EntryId |
string |
The ID of the event target that failed to be processed. |
Mlm123456JHd2RsRoKw |
| Code |
string |
The return code of the API.
|
Success |
| Success |
boolean |
The value `true` is returned if the operation is successful. |
true |
Examples
Success response
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 |
Description |
|---|---|---|---|
| 403 | ServiceNotEnable | Service not enable |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.