Queries routes in a route table.
Usage notes
Before you call the DeleteRouteEntry operation to delete a route, you can call this operation to query the next hop of the route that you want to delete.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
RegionId | String | Yes | cn-hangzhou | The region ID of the route table. You can call the DescribeRegions operation to query the most recent region list. |
RouteTableId | String | Yes | vtb-bp1r9pvl4xen8s9ju**** | The ID of the route table. |
RouteEntryId | String | No | rte-bp1mnnr2al0naomnp**** | The ID of the route that you want to query. |
DestinationCidrBlock | String | No | 192.168.2.0/24 | The destination CIDR block of the route. IPv4 and IPv6 CIDR blocks are supported. |
RouteEntryName | String | No | abc | The name of the route. The name must be 1 to 128 characters in length, and cannot start with |
IpVersion | String | No | ipv4 | The IP version. Valid values:
|
RouteEntryType | String | No | System | The type of the route. Valid values:
|
NextHopId | String | No | vpn-bp10zyaph5cc8b7c7**** | The ID of the next hop. |
NextHopType | String | No | Instance | The type of the next hop. Valid values:
|
MaxResult | Integer | No. | 10 | The number of entries to return on each page. Valid values: 1 to 100. Default value: 10. |
NextToken | String | No | FFmyTO70tTpLG6I3FmYAXGKPd**** | The token that is used for the next query. Valid values:
|
Action | String | Yes | DescribeRouteEntryList | The operation that you want to perform. Set the value to DescribeRouteEntryList. |
ServiceType | String | No | TR | Specifies whether to host the route. If the parameter is empty, the route is not hosted. If you set the value to TR, the route is hosted by a transit router. |
DestCidrBlockList.N | String | No | 192.168.0.0/24 | The destination CIDR blocks of the route. You can specify at most 20 destination CIDR blocks. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
NextToken | String | FFmyTO70tTpLG6I3FmYAXGKPd**** | The token that is used for the next query. Valid values:
|
RequestId | String | 14A07460-EBE7-47CA-9757-12CC4761D47A | The ID of the request. |
RouteEntrys | Array of RouteEntry | The information about the routes. | |
RouteEntry | |||
Status | String | Available | The status of the route. Valid values:
|
Type | String | Custom | The type of the route. Valid values:
|
IpVersion | String | ipv4 | The IP version. Valid values:
|
Description | String | RouteEntryDescription | The description of the route. |
RouteEntryName | String | aaa | The name of the route. |
DestinationCidrBlock | String | 192.168.2.0/24 | The destination CIDR blocks of the route. |
RouteEntryId | String | rte-bp1mnnr2al0naomnp**** | The ID of the route. |
RouteTableId | String | vtb-bp15w5q90d2rk3bww**** | The ID of the route table. |
GmtModified | String | 2022-05-09T03:00:07Z | The time when the route was modified. The time is displayed in |
NextHops | Array of NextHop | The information about the next hops. | |
NextHop | |||
NextHopRegionId | String | cn-hangzhou | The region ID of the next hop. Note This parameter is returned if the next hop type is set to RouterInterface. |
Weight | Integer | 100 | The weight of the route. Note This parameter is returned if the next hop type is set to RouterInterface. |
NextHopId | String | vpn-bp10zyaph5cc8b7c7**** | The ID of the next hop. |
Enabled | Integer | 1 | Indicates whether the route is available. Valid values:
Note This parameter is returned if the next hop type is set to RouterInterface. |
NextHopType | String | Instance | The type of the next hop. Valid values:
|
NextHopRelatedInfo | Object | The information about the next hop. | |
InstanceId | String | vpc-bp1t36rn9l53iwbsf**** | The ID of the instance associated with the next hop. |
InstanceType | String | VPC | The type of the instance associated with the next hop. Valid values:
|
RegionId | String | ch-hangzhou | The region ID of the instance associated with the next hop. |
ServiceType | String | TR | Indicates whether the route is hosted. If the parameter is empty, the route is not hosted. If the value is set to TR, the route is hosted by a transit router. |
Examples
Sample requests
http(s)://[Endpoint]/?RegionId=cn-hangzhou
&RouteTableId=vtb-bp1r9pvl4xen8s9ju****
&RouteEntryId=rte-bp1mnnr2al0naomnp****
&DestinationCidrBlock=192.168.2.0/24
&RouteEntryName=abc
&IpVersion=ipv4
&RouteEntryType=System
&NextHopId=vpn-bp10zyaph5cc8b7c7****
&NextHopType=Instance
&MaxResult=10
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&Action=DescribeRouteEntryList
&ServiceType=TR
&DestCidrBlockList=["192.168.0.0/24"]
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeRouteEntryListResponse>
<NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
<RequestId>14A07460-EBE7-47CA-9757-12CC4761D47A</RequestId>
<RouteEntrys>
<Status>Available</Status>
<Type>Custom</Type>
<IpVersion>ipv4</IpVersion>
<Description>RouteEntryDescription</Description>
<RouteEntryName>aaa</RouteEntryName>
<DestinationCidrBlock>192.168.2.0/24</DestinationCidrBlock>
<RouteEntryId>rte-bp1mnnr2al0naomnp****</RouteEntryId>
<RouteTableId>vtb-bp15w5q90d2rk3bww****</RouteTableId>
<GmtModified>2022-05-09T03:00:07Z</GmtModified>
<NextHops>
<NextHopRegionId>cn-hangzhou</NextHopRegionId>
<Weight>100</Weight>
<NextHopId>vpn-bp10zyaph5cc8b7c7****</NextHopId>
<Enabled>1</Enabled>
<NextHopType>Instance</NextHopType>
<NextHopRelatedInfo>
<InstanceId>vpc-bp1t36rn9l53iwbsf****</InstanceId>
<InstanceType>VPC</InstanceType>
<RegionId>ch-hangzhou</RegionId>
</NextHopRelatedInfo>
</NextHops>
<ServiceType>TR</ServiceType>
</RouteEntrys>
</DescribeRouteEntryListResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd****",
"RequestId" : "14A07460-EBE7-47CA-9757-12CC4761D47A",
"RouteEntrys" : [ {
"Status" : "Available",
"Type" : "Custom",
"IpVersion" : "ipv4",
"Description" : "RouteEntryDescription",
"RouteEntryName" : "aaa",
"DestinationCidrBlock" : "192.168.2.0/24",
"RouteEntryId" : "rte-bp1mnnr2al0naomnp****",
"RouteTableId" : "vtb-bp15w5q90d2rk3bww****",
"GmtModified" : "2022-05-09T03:00:07Z",
"NextHops" : [ {
"NextHopRegionId" : "cn-hangzhou",
"Weight" : 100,
"NextHopId" : "vpn-bp10zyaph5cc8b7c7****",
"Enabled" : 1,
"NextHopType" : "Instance",
"NextHopRelatedInfo" : {
"InstanceId" : "vpc-bp1t36rn9l53iwbsf****",
"InstanceType" : "VPC",
"RegionId" : "ch-hangzhou"
}
} ],
"ServiceType" : "TR"
} ]
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | OperationFailed.QueryCenEntry | Operation is denied because getting CEN route entry has failed. | The error message returned because the system failed to query the CEN routes. |
400 | OperationDenied.UseGatewayRouteEntryQueryInterface | Use listGatewayRouteTableEntries to describe gateway route entries. | To query the routes of a gateway route table, call the listGatewayRouteTableEntries operation. |
For a list of error codes, visit the API Error Center.