All Products
Search
Document Center

Virtual Private Cloud:DeleteRouteEntry

Last Updated:Nov 13, 2024

Deletes a route entry from a route table of a VRouter or virtual border router (VBR).

Operation description

When you call this operation, take note of the following items:

  • You can delete only routes that are in the Available state.

  • You cannot delete a route entry of a virtual private cloud (VPC) in which a vSwitch or another route entry is being created or deleted.

  • 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.

  • 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 the DescribeRouteEntryList operation 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 entry, the route entry 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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:DeleteRouteEntrydelete
  • RouteTable
    acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringNo

The region ID of the route table.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
RouteTableIdstringNo

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

vtb-2ze3jgygk9bmsj23s****
RouteEntryIdstringNo

The ID of the route that you want to delete.

rte-bp1mnnr2al0naomnpv****
DestinationCidrBlockstringNo

The destination CIDR block of the route. Only IPv4 CIDR blocks, IPv6 CIDR blocks, and prefix lists are supported.

47.100.XX.XX/16
NextHopIdstringNo

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.
ri-2zeo3xzyf38r4urzd****
NextHopListarray<object>No

The list of the next hop of the ECMP route.

objectNo

The information about the next hop of the ECMP route.

NextHopIdstringNo

The ID of the next hop that is configured for ECMP routing. You can specify information about at most 16 next hops.

ri-2zeo3xzyf38r43cd****
NextHopTypestringNo

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.

RouterInterface

Response parameters

ParameterTypeDescriptionExample
object

The returned information.

RequestIdstring

The ID of the request.

0ED8D006-F706-4D23-88ED-E11ED28DCAC0

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400MissingParameterMiss mandatory parameter.Some required parameters are not specified. Specify all required parameters and try again.
400IncorrcetRouteEntryStatusSome route entry status blocked this operation.One or more routes in the route table are in the Pending or Modifying state.
400InvalidCidrBlock.MalformedSpecified CIDR block is not valid.The format of the CIDR block is invalid.
400OperationDeniedSpecified operation is denied as route entry type is system.The specified route is a system route.
400InvalidRouteEntry.NotFoundRoute entry not exists.The route entry does not exist.
400InvalidVRouter.NotFoundvRouter not exists.The specified vRouter does not exist. Check whether the specified vRouter is valid.
400IncorrectRouteEntryStatusSome route entry status blocked this operation.The operation is not supported because the route table contains routes in the Pending or Modifying state.
400IncorrectRouteEntryStatusVBR has NotStable route entry.The operation is not supported because the route table contains routes in the Pending or Modifying state.
400IncorrectRouteEntryStatusSpecified routeEntry status error.The operation is not supported because the route table contains routes in the Pending or Modifying state.
400ForbbidenSpecified RouteEntry cannot allowed delete by openApi.You cannot call this operation to delete the specified route.
400InvalidNextHopSpecified nexthop and nexthop list cannot both null.The next hop and next hop list cannot be empty at the same time.
400InvalidRouteEntrySpecified routeEntry not exist.The specified route entry does not exist.
400Forbidden.VRouterNotFoundpecified virtual switch is not found during access authentication.-
400TaskConflictThe operation is too frequent, TaskConflict.The system is unavailable. Try again later.
400InvalidRouteEntryId.NotFoundSpecified RouteEntryId does not exist.The specified route is not found.
400IncorrectVpcStatusCurrent VPC status does not support this operation.This operation cannot be performed when the VPC is in the current state.
400InvalidVpnInstanceId.NotFound%s-
400ParamExclusive.RouteEntryIdAndRouteTableIdOrDestCidrBlock%s-
400InvalidNextHopList.SizeNexthop list size should be between 2 and 16-
400ParamExclusive.NextHopIdAndListNextHopId and NextHopList cannot both be not null.-
400OperationFailed.DeleteMultiScopeEntryMulti or ecmp scope must delete with force.-
400OperationFailed.DistibuteLockDistibute lock fail.The operation is locked by another request;
400OperationDenied.DeleteManagedRouteEntryThe operation is not allowed because of route entry is managed.You cannot delete hosted routes.
400OperationDenied.RouteTableTypeNotPermittedThe operation is not allowed because the type of route table is not permitted.You cannot create routes for route tables of the specified type.
400IncorrectStatus.VpcRouteEntryThe status of the specified routeEntry is invalid.The status of the VPC route entry is invalid.
400OperationDenied.NextHopNotChangedThe operation is not allowed because of NextHopNotChanged.The operation is not allowed because the next hop is not changed.
400OperationDenied.DeleteGatewayEndpointRouteThe operation is not allowed to delete route entry pointing gateway endpoint..You cannot delete a route that points to a gateway endpoint.
400IncorrectStatus.PrefixListThe status of prefixList is incorrect.The prefix list is in an unstable state.
404InvalidRouteTableId.NotFoundSpecified route table does not exist.The specified route table does not exist.
404InvalidVpcId.NotFoundSpecified value of VpcId is not found in our record.The VPC does not exist. Check whether the specified VPC is valid.
500Vpc.Errorerror code 500,Internal server error.-
500Internal.ErrorThe request processing has failed due to some unknown error, exception or failure.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-10-28The Error code has changedView Change Details
2024-06-19The Error code has changedView Change Details
2024-06-05The Error code has changedView Change Details
2024-06-03The Error code has changedView Change Details
2023-09-06The Error code has changedView Change Details
2023-08-15The Error code has changedView Change Details
2023-08-03The Error code has changedView Change Details
2023-07-20API Description Update. The Error code has changedView Change Details
2023-05-08The Error code has changedView Change Details