Deletes a route from a route table of a vRouter or virtual border router (VBR).
Usage notes
When you call this operation, take note of the following rules:
- Only routes in the Available state can be deleted.
- You cannot delete a route of a virtual private cloud (VPC) in which a vSwitch or a route is being created.
- To delete a route from the route table of a VBR, query the NextHopId by calling the DescribeRouteEntryList operation. Then, call this operation to delete the route.
- DeleteRouteEntry is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call DescribeRouteEntryList to query the status of the task.
- If the route is in the Deleting state, the route is being deleted.
- If you cannot query the route, the route is deleted.
- You cannot repeatedly call DeleteRouteEntry within a specific time period.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | DeleteRouteEntry | The operation that you want to perform. Set the value to DeleteRouteEntry. |
RegionId | String | No | cn-hangzhou | The region ID of the route table. You can call the DescribeRegions operation to query the most recent region list. |
RouteTableId | String | No | vtb-2ze3jgygk9bmsj23s**** | The ID of the route table to which the route belongs. |
RouteEntryId | String | Yes | rte-bp1mnnr2al0naomnpv**** | The ID of the route that you want to delete. |
DestinationCidrBlock | String | No | 47.100.XX.XX/16 | The destination CIDR block of the route. IPv4 and IPv6 CIDR blocks are supported. |
NextHopId | String | No | ri-2zeo3xzyf38r4urzd**** | The ID of the next hop.
|
NextHopList.N.NextHopId | String | No | ri-2zeo3xzyf38r43cd**** | The ID of the next hop that is configured for ECMP routing. You can specify information about at most 16 next hops. |
NextHopList.N.NextHopType | String | No | RouterInterface | The type of the next hop of the ECMP route. Set the value to RouterInterface. You can specify information about at most 16 next hops. |
Response parameters
Parameter | Type | Example | Description |
RequestId | String | 0ED8D006-F706-4D23-88ED-E11ED28DCAC0 | The request ID. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=DeleteRouteEntry
&RegionId=cn-hangzhou
&RouteTableId=vtb-2ze3jgygk9bmsj23s****
&RouteEntryId=rte-bp1mnnr2al0naomnpv****
&DestinationCidrBlock=47.100.XX.XX/16
&NextHopId=ri-2zeo3xzyf38r4urzd****
&NextHopList=[{"NextHopId":"ri-2zeo3xzyf38r43cd****","NextHopType":"RouterInterface"}]
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DeleteRouteEntryResponse>
<RequestId>0ED8D006-F706-4D23-88ED-E11ED28DCAC0</RequestId>
</DeleteRouteEntryResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}
Error codes
HttpCode | Error code | Error message | Description |
400 | MissingParameter | Miss mandatory parameter. | One or more required parameters are not set. Check whether you have set all required parameters before you call this operation. |
400 | IncorrcetRouteEntryStatus | Some route entry status blocked this operation. | One or more routes in the route table are in the Pending or Modifying state. |
400 | InvalidCidrBlock.Malformed | Specified CIDR block is not valid. | The format of the specified CIDR block is invalid. |
400 | OperationDenied | Specified operation is denied as route entry type is system. | The specified route is a system route. |
400 | InvalidRouteEntry.NotFound | Route entry not exists. | The route does not exist. |
400 | InvalidVRouter.NotFound | vRouter not exists. | The specified vRouter does not exist. Check whether the specified vRouter is valid. |
400 | IncorrectRouteEntryStatus | Some route entry status blocked this operation. | One or more routes in the current route table are in the Pending or Modifying state. |
400 | IncorrectRouteEntryStatus | VBR has NotStable route entry. | One or more routes in the current VBR are in the Pending or Modifying state. |
400 | IncorrectRouteEntryStatus | Specified routeEntry status error. | One or more routes in the current route table are in the Pending or Modifying state. |
400 | Forbbiden | Specified RouteEntry cannot allowed delete by openApi. | You cannot call this operation to delete the specified route. |
400 | InvalidNextHop | Specified nexthop and nexthop list cannot both null. | The next hop and next hop list cannot be empty at the same time. |
400 | InvalidRouteEntry | Specified routeEntry not exist. | The specified route does not exist. |
400 | TaskConflict | The operation is too frequent, TaskConflict. | The system is unavailable. Try again later. |
400 | InvalidRouteEntryId.NotFound | Specified RouteEntryId does not exist. | The specified route does not exist. |
400 | IncorrectVpcStatus | Current VPC status does not support this operation. | This operation cannot be performed when the VPC is in the current state. |
400 | OperationDenied.DeleteManagedRouteEntry | The operation is not allowed because of route entry is managed. | You cannot delete hosted routes. |
400 | OperationDenied.RouteTableTypeNotPermitted | The operation is not allowed because the type of route table is not permitted. | You cannot add routes to route tables of the specified type. |
400 | IncorrectStatus.VpcRouteEntry | The status of the specified routeEntry is invalid. | The status of the VPC route is invalid. |
404 | InvalidRouteTableId.NotFound | Specified route table does not exist. | The route table is not found. |
404 | InvalidVpcId.NotFound | Specified value of VpcId is not found in our record. | The VPC is not found. |
For a list of error codes, see Service error codes.