调用DeleteRouteEntry接口删除VPC路由器或边界路由器的路由表中的路由条目。
使用说明
调用本接口删除路由条目时,请注意:
- 只有处于Available状态的路由条目可以被删除。
- 路由表所在的VPC正在进行创建或删除交换机或路由条目时,无法删除路由条目。
- 如果需要删除边界路由器的路由表中的路由条目,请通过DescribeRouteEntryList接口查询要删除的路由条目的NextHopId 后,再通过本接口删除路由条目。
- DeleteRouteEntry接口属于异步接口,即系统会返回一个请求ID,但该路由条目尚未删除成功,系统后台的删除任务仍在进行。您可以调用DescribeRouteEntryList查询路由条目的删除状态:
- 当路由条目处于Deleting状态时,表示路由条目正在删除中。
- 当查询不到指定的路由条目时,表示路由条目删除成功。
- DeleteRouteEntry接口不支持在同一个VPC或者同一个VBR中并发删除路由表中的路由条目。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DeleteRouteEntry | 系统规定参数。取值:DeleteRouteEntry。 |
RegionId | String | 否 | cn-hangzhou | 路由表所属地域的ID。 您可以通过调用DescribeRegions接口获取地域ID。 |
RouteTableId | String | 否 | vtb-2ze3jgygk9bmsj23s**** | 路由条目所在的路由表的ID。 |
RouteEntryId | String | 是 | rte-bp1mnnr2al0naomnpv**** | 要删除的路由条目ID。 |
DestinationCidrBlock | String | 否 | 47.100.XX.XX/16 | 路由条目的目标网段,支持IPv4和IPv6网段。 |
NextHopId | String | 否 | ri-2zeo3xzyf38r4urzd**** | 下一跳实例的ID。
|
NextHopList.N.NextHopId | String | 否 | ri-2zeo3xzyf38r43cd**** | ECMP路由条目的下一跳实例的ID。最多支持16个下一跳实例信息。 |
NextHopList.N.NextHopType | String | 否 | RouterInterface | ECMP路由的下一跳的类型,目前只能取值RouterInterface(路由器接口)。最多支持16个下一跳实例信息。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 0ED8D006-F706-4D23-88ED-E11ED28DCAC0 | 请求ID。 |
示例
请求示例
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"}]
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<DeleteRouteEntryResponse>
<RequestId>0ED8D006-F706-4D23-88ED-E11ED28DCAC0</RequestId>
</DeleteRouteEntryResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | MissingParameter | Miss mandatory parameter. | 缺少必要参数,请您检查必填参数是否都已填后再进行操作。 |
400 | IncorrcetRouteEntryStatus | Some route entry status blocked this operation. | 无法执行该操作,因为有些路由条目的状态是pending或modifying。 |
400 | InvalidCidrBlock.Malformed | Specified CIDR block is not valid. | 该CIDR格式不正确。 |
400 | OperationDenied | Specified operation is denied as route entry type is system. | 无法执行该操作,因为路由条目是系统路由。 |
400 | InvalidRouteEntry.NotFound | Route entry not exists. | 该路由条目不存在,请您检查路由条目是否正确。 |
400 | InvalidVRouter.NotFound | vRouter not exists. | 路由器不存在,请您检查输入的路由器是否正确。 |
400 | IncorrectRouteEntryStatus | Some route entry status blocked this operation. | 无法执行该操作,当前路由表中有路由条目的状态为pending或modifying。 |
400 | IncorrectRouteEntryStatus | VBR has NotStable route entry. | 无法执行该操作,边界路由表中有路由条目的状态为pending或modifying。 |
400 | IncorrectRouteEntryStatus | Specified routeEntry status error. | 无法执行该操作,当前路由表中有路由条目的状态为pending或modifying。 |
400 | Forbbiden | Specified RouteEntry cannot allowed delete by openApi. | 不允许使用API删除该路由条目。 |
400 | InvalidNextHop | Specified nexthop and nexthop list cannot both null. | 下一跳和下一跳列表不能同时为空。 |
400 | InvalidRouteEntry | Specified routeEntry not exist. | 该路由条目不存在。 |
400 | TaskConflict | The operation is too frequent, TaskConflict. | 操作太频繁,请稍后重试 |
400 | InvalidRouteEntryId.NotFound | Specified RouteEntryId does not exist. | 指定的路由条目未找到 |
400 | IncorrectVpcStatus | Current VPC status does not support this operation. | 当前VPC的状态无法支持这个操作。 |
400 | OperationDenied.DeleteManagedRouteEntry | The operation is not allowed because of route entry is managed. | 无法删除被云服务托管的路由。 |
404 | InvalidRouteTableId.NotFound | Specified route table does not exist. | 该路由表不存在。 |
404 | InvalidVpcId.NotFound | Specified value of VpcId is not found in our record. | 该VPC不存在,请您检查输入的VPC是否正确。 |
访问错误中心查看更多错误码。