Deletes one or more event targets of an event rule.
Operation description
You can call this API operation to delete one or more event targets of an event 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:DeleteTargets | delete | *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. | MyEventBus |
RuleName | string | Yes | The name of the event rule. | ramrolechange-mns |
TargetIds | array | No | The IDs of the event targets that you want to delete. | |
string | No | The ID of the event target.
You can call the GetRule operation to query the IDs of event targets. | 12 |
Sample request: `POST /openapi/deleteTargets HTTP/1.1 Host: 123456789098****.eventbridge.cn-hangzhou.aliyuncs.com Date: Sat, 18 Apr 2020 05:30:41 GMT x-eventbridge-version: 2020-04-01 Authorization: acs vZ3VL0SuJdHi****:Jo2PbT*****4azYAYoYslKLvWzg= Content-type: application/json;charset=UTF-8 Content-Length: 26
{ "EventBusName":"default", "RuleName":"myRule", "TargetIds": [ "targetId1", "targetId2" ] }`
Response parameters
Examples
Sample success responses
JSON
format
{
"Message": "EventBusNotExist",
"RequestId": "78FA9EAC-F0C0-58B0-871E-9F9756CE1D29",
"Data": {
"ErrorEntriesCount": 0,
"ErrorEntries": [
{
"ErrorMessage": "The id of event target is duplicate!",
"ErrorCode": "EventRuleTargetIdDuplicate",
"EntryId": "target5"
}
]
},
"Code": "200",
"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-04-09 | The Error code has changed | View Change Details |