Deletes a router entry from a route table.

Note the following before deleting a route entry:
  • You can only delete a route entry that is in the available state.

  • You cannot delete a route entry from a VPC that is creating or deleting a VSwitch or route entry.

Debug

By using API Explorer, you can easily debug APIs, automatically generate SDK code examples, and quickly search for APIs.

Request parameters

Parameter Type Required? Example value Description
Action String Yes DeleteRouteEntry

The name of this action. Value:

DeleteRouteEntry

DestinationCidrBlock String Yes 0.0.0.0/0

The destination CIDR block of the route entry to be deleted. Both IPv4 and IPv6 CIDR blocks are supported.

RegionId String Yes cn-hangzhou

The ID of the region to which the route table belongs.

RouteTableId String Yes trb-2ze3jgygk9bmsj23sfe12

The ID of the route table to which the route entry to be deleted belongs.

NextHopId String No ri-2zeo3xzyf38r4urzdpvfs

The instance ID of the next hop.

NextHopList.N.NextHopId String No ri-2zeo3xzyf38r43cds23qw

The instance ID of the next hop.

NextHopList.N.NextHopType String No RouterInterface

The type of the next hop. Valid values:

  • Instance: ECS instance (default)
  • HaVip: HaVip
  • RouterInterface: router interface

Response parameters

Parameter Type Example value Description
RequestId String 0ED8D006-F706-4D23-88ED-E11ED28DCAC0 The ID of the request.

Example

Request example


https://vpc.aliyuncs.com/?Action=DeleteRouteEntry
&DestinationCidrBlock=0.0.0.0/0
&RouteTableId=trb-2ze3jgygk9bmsj23sfe12
&<CommonParameters>
Response example
  • XML format

    <DeleteRouteEntryResponse>
      <RequestId>0ED8D006-F706-4D23-88ED-E11ED28DCAC0</RequestId>
    </DeleteRouteEntryResponse>
    
  • JSON format

    {
    	"RequestId":"0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
    }

Error codes

HTTP status code Error code Error message Description
400 MissingParameter Miss mandatory parameter. The required parameters are missing.
400 IncorrcetRouteEntryStatus Some route entry status blocked this operation. This operation cannot be performed because one or more route entries is in the pending or modifying state.
404 InvalidRouteTableId.NotFound Specified route table does not exist. The specified route table does not exist.
400 OperationDenied Specified operation is denied as route entry type is system. This operation cannot be performed because the route entry is the system route entry.
400 InvalidRouteEntry.NotFound Route entry not exists. The route entry does not exist.
400 InvalidVRouter.NotFound vRouter not exists. The router does not exist.
400 IncorrectRouteEntryStatus VBR has NotStable route entry. The VBR route table contains entries in the Pending or Modifying status.
400 IncorrectRouteEntryStatus Specified routeEntry status error. The route table contains entries in the Pending or Modifying state.
400 Forbbiden Specified RouteEntry cannot allowed delete by openApi. You cannot delete the route entry by calling an API.
400 InvalidRouteEntry Specified routeEntry not exist. The specified route entry does not exist.
400 IncorrectRouteEntryStatus Vpc NotStable route entry. The route table contains entries in the Pending or Modifying state.
400 IncorrectVpcStatus Current VPC status does not support this operation. The status of VPC does not support the action.

See common error codes