Deletes custom route entries in a batch.
Operation description
When you call this operation to delete route entries, take note of the following items:
-
Only route entries in the Available state can be deleted.
-
Route entries cannot be deleted if the VPC to which the route table belongs has a vSwitch or route entry being created or deleted.
-
The DeleteRouteEntries operation is asynchronous. After you send a request, the system returns a request ID. However, the route entry is not yet deleted. The deletion task runs in the background. You can call DescribeRouteEntryList to query the deletion status of the route entry:
If the route entry is in the Deleting state, the route entry is being deleted.
If the specified route entry cannot be found, the route entry is deleted.
-
The DeleteRouteEntries operation does not support concurrent batch deletion of route entries from route tables in the same VPC.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:DeleteRouteEntries |
delete |
*RouteTable
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The ID of the region where the route table resides. You can call the DescribeRegions operation to query the region ID. |
cn-hangzhou |
| RouteEntries |
array<object> |
No |
The information about the route entries to delete. |
|
|
object |
No |
The information about the route entries to delete. |
||
| DstCidrBlock |
string |
No |
The destination CIDR block of the route entry to delete. IPv4 CIDR blocks, IPv6 CIDR blocks, and prefix list CIDR blocks are supported. You can specify up to 50 destination CIDR blocks. Note
If the RouteEntryId parameter is not specified, the DstCidrBlock and NextHop parameters are required. |
47.100.XX.XX/24 |
| NextHop |
string |
No |
The ID of the next hop instance to delete. You can specify up to 50 instance IDs. Note
If the RouteEntryId parameter is not specified, the DstCidrBlock and NextHop parameters are required. |
i-j6c2fp57q8rr4jlu**** |
| RouteEntryId |
string |
No |
The ID of the route entry to delete. You can specify up to 50 route entry IDs. Note
If the RouteEntryId parameter is not specified, the DstCidrBlock and NextHop parameters are required. |
rte-bp1mnnr2al0naomnpv**** |
| RouteTableId |
string |
Yes |
The ID of the route table that contains the route entry to delete. You can specify up to 50 route table IDs. |
vtb-2ze3jgygk9bmsj23s**** |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run. Valid values: true: performs a dry run without actually deleting the route entries. The system checks the AccessKey pair, the authorization of the Resource Access Management (RAM) user, and the required parameters. If the check fails, the corresponding error is returned. If the check passes, the false (default): sends a normal request. If the check passes, a 2xx HTTP status code is returned and the route entries are deleted. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| FailedCount |
integer |
The number of route entries that failed to be deleted. |
2 |
| FailedRouteEntries |
array<object> |
The information about the route entries that failed to be deleted. |
|
|
object |
The information about the route entries that failed to be deleted. |
||
| DstCidrBlock |
string |
The destination CIDR block of the route entry that failed to be deleted. IPv4 CIDR blocks, IPv6 CIDR blocks, and prefix list CIDR blocks are supported. |
47.100.XX.XX/24 |
| FailedCode |
string |
The error code returned for the failure. |
VPC_ROUTER_ENTRY_NOT_EXIST |
| FailedMessage |
string |
The error message returned for the failure. |
vRouterEntry not exists |
| NextHop |
string |
The instance ID of the next hop that failed to be deleted. |
i-j6c2fp57q8rr4jlu**** |
| RouteEntryId |
string |
The ID of the route entry that failed to be deleted. |
rte-bp1mnnr2al0naomnpv**** |
| RequestId |
string |
The request ID. |
0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
| SuccessCount |
integer |
The number of route entries that were deleted. |
2 |
Examples
Success response
JSON format
{
"FailedCount": 2,
"FailedRouteEntries": [
{
"DstCidrBlock": "47.100.XX.XX/24",
"FailedCode": "VPC_ROUTER_ENTRY_NOT_EXIST",
"FailedMessage": "vRouterEntry not exists",
"NextHop": "i-j6c2fp57q8rr4jlu****",
"RouteEntryId": "rte-bp1mnnr2al0naomnpv****"
}
],
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0",
"SuccessCount": 2
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | DryRunOperation | Request validation has been passed with DryRun flag set. | The request passed the dry run. |
| 400 | TaskConflict | The operation is too frequent. Please wait a moment and try again. | The system is unavailable. Try again later. |
| 400 | MissingParam.RouteTableId | The parameter RouteTableId is missing. | The required parameter RouteTableId is missing. |
| 400 | IncorrectStatus.PrefixListRelation | The related prefix list relation is in an intermediate state and cannot perform the current operation. | The associated prefix list association is in an intermediate state, and the current operation cannot be performed. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.