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:

  • 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.
  • Before you call this operation to delete a route of a VBR route table, call the DescribeRouteEntryList operation to query the NextHopId of the route first.
  • The DeleteRouteEntry operation is asynchronous. After you send the request, the system returns a request ID. However, the operation is still being performed in the system background. You can call the DescribeRouteEntryList operation to query the status of a route:
    • 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 the DeleteRouteEntry operation to delete a route from the route table of a vRouter or a VBR within the specified period of time.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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 entry. IPv4 and IPv6 CIDR blocks are supported.

NextHopId String No ri-2zeo3xzyf38r4urzd****

The ID of the next hop.

  • To delete a route other than an equal-cost multi-path (ECMP) route, set the NextHopId parameter and ignore the NextHopList parameter.
  • To delete an ECMP route, set the NextHopList parameter and ignore the NextHopId parameter.
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 that is configured for ECMP routing. 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 ID of the request.

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. The error message returned because some 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 route entries in the route table 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 entry is a system route entry.
400 InvalidRouteEntry.NotFound Route entry not exists. The error message returned because the specified route entry does not exist. Check whether the specified route entry is valid.
400 InvalidVRouter.NotFound vRouter not exists. The error message returned because the specified router does not exist. Check whether the specified router is valid.
400 IncorrectRouteEntryStatus Some route entry status blocked this operation. The error message returned because one or more route entries in the current 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 route entries in the current 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 the next hop and next hop list cannot be empty at the same time.
400 InvalidRouteEntry Specified routeEntry not exist. The error message returned because the specified route does not exist.
400 TaskConflict The operation is too frequent, TaskConflict. The error message returned because the system is busy. Try again later.
400 InvalidRouteEntryId.NotFound Specified RouteEntryId does not exist. The error message returned because the specified route entry 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.
400 OperationDenied.DeleteManagedRouteEntry The operation is not allowed because of route entry is managed. The error message returned because you cannot delete hosted routes.
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 whether the specified VPC ID is valid.

For a list of error codes, see Service error codes.