Deletes a route from a route table of a vRouter or virtual border router (VBR).
Description
When you call this operation, take note of the following rules:
- You can delete only routes that are in the Available state.
- 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 of a VBR, call the DescribeRouteEntryList operation to query the NextHopId of the route first.
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 | trb-2ze3jgygk9bmsj23s**** |
The ID of the route table to which the route belongs. |
RouteEntryId | String | No | rte-bp1mnnr2al0naomnpv**** |
The ID of the route that you want to delete. |
DestinationCidrBlock | String | No | 0.0.0.0/0 |
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. To delete a route that is configured for equal-cost multi-path (ECMP) routing, set the NextHopList parameter. If the route that you want to delete is not configured for ECMP routing, set the NextHopId parameter. You cannot leave both NextHopId and NextHopList empty. |
NextHopList.N.NextHopId | String | No | ri-2zeo3xzyf38r43cd**** |
The ID of the next hop that is configured for ECMP routing. |
NextHopList.N.NextHopType | String | No | RouterInterface |
The type of the next hop that is configured for ECMP routing. Set the value to RouterInterface. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
The ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=DeleteRouteEntry
&ResourceOwnerId=123
&RegionId=cn-hangzhou
&RouteTableId=trb-2ze3jgygk9bmsj23s****
&RouteEntryId=rte-bp1mnnr2al0naomnpv****
&DestinationCidrBlock=0.0.0.0/0
&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. | The error message returned because 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. | The error message returned because one or more routes are in the Pending or Modifying state. |
400 | InvalidCidrBlock.Malformed | Specified CIDR block is not valid. | The error message returned because the format of the specified CIDR block is invalid. |
400 | OperationDenied | Specified operation is denied as route entry type is system. | The error message returned because the specified route is a system route. |
400 | InvalidRouteEntry.NotFound | Route entry not exists. | The error message returned because the specified route does not exist. Check the parameter and try again. |
400 | InvalidVRouter.NotFound | vRouter not exists. | The error message returned because the specified vRouter does not exist. Check the parameter and try again. |
400 | IncorrectRouteEntryStatus | Some route entry status blocked this operation. | The error message returned because one or more routes in the route table are in the Pending or Modifying state. |
400 | IncorrectRouteEntryStatus | VBR has NotStable route entry. | The error message returned because one or more routes in the VBR are in the Pending or Modifying state. |
400 | IncorrectRouteEntryStatus | Specified routeEntry status error. | The error message returned because one or more routes in the route table are in the Pending or Modifying state. |
400 | Forbbiden | Specified RouteEntry cannot allowed delete by openApi. | The error message returned because you cannot call this operation to delete the specified route. |
400 | InvalidNextHop | Specified nexthop and nexthop list cannot both null. | The error message returned because neither the next hop nor the next hop list is specified. |
400 | InvalidRouteEntry | Specified routeEntry not exist. | The error message returned because the specified route does not exist. |
400 | IncorrectVpcStatus | Current VPC status does not support this operation. | The error message returned because this operation cannot be performed when the VPC is in the current state. |
404 | InvalidRouteTableId.NotFound | Specified route table does not exist. | The error message returned because the specified route table does not exist. |
404 | InvalidVpcId.NotFound | Specified value of VpcId is not found in our record. | The error message returned because the specified VPC does not exist. Check the parameter and try again. |
For a list of error codes, visit the API Error Center.