Deletes a custom route entry from a route table.

Before you begin

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 having a VSwitch or route entry created or deleted.

Make the API call

You can use OpenAPI Explorer to make API calls, search for API calls, perform debugging, and generate SDK example code.

Request parameters

Parameter Type Required? Example value Description
Action String Yes DeleteRouteEntry

The name of this action. Value: DeleteRouteEntry

RegionId String Yes cn-hangzhou

The ID of the region to which the route table belongs. To query the region ID, call DescribeRegions.

DestinationCidrBlock String No 0.0.0.0/0

The destination CIDR block of the route entry. IPv4 and IPv6 CIDR blocks are supported.

NextHopId String No ngw-bp1vpo4l2vd7zef8o****

The instance ID of the next hop.

NextHopList.N.NextHopId String No ri-2zeo3xzyf38r43cd****

The ID of the next-hop instance of the ECMP route.

NextHopList.N.NextHopType String No RouterInterface

The type of the next hop of the ECMP route. Valid value: RouterInterface (router interface).

RouteEntryId String No rte-bp1mnnr2al0naomn****

The ID of the route entry to be deleted.

RouteTableId String No vtb-hp37isva36oj7839j****

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

Response parameters

Parameter Type Example value Description
RequestId String 0ED8D006-F706-4D23-88ED-E11ED28DCAC0

The ID of the request.

Examples

Request example


https://vpc.aliyuncs.com/?Action=DeleteRouteEntry
&DestinationCidrBlock=0.0.0.0/0
&RouteTableId=trb-2ze3jgygk9bmsj23s****
&<CommonParameters>

Response example

XML format

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

JSON format

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

Errors

HTTP status code Error code Error message Description
400 MissingParameter Miss mandatory parameter. One or more required parameters are missing.
400 IncorrcetRouteEntryStatus Some route entry status blocked this operation. You cannot perform this operation because one or more route entries in the current route table are in the pending or modifying state.
400 InvalidCidrBlock.Malformed Specified CIDR block is not valid. The specified CIDR format is invalid.
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 specified route entry does not exist.
400 InvalidVRouter.NotFound vRouter not exists. The specified VRouter does not exist.
400 IncorrectRouteEntryStatus Some route entry status blocked this operation. You cannot perform this operation 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. You cannot perform this operation because one or more route entries in the current VBR are in the pending or modifying state.
404 InvalidVpcId.NotFound Specified value of VpcId is not found in our record. The specified VPC does not exist.
400 IncorrectRouteEntryStatus Specified routeEntry status error. You cannot perform this operation 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. You cannot call this action to delete the specified route entry.
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 entry does not exist.
400 IncorrectVpcStatus Current VPC status does not support this operation. The current status of the VPC does not support the action.

For a list of error codes, visit the API Error Center.