Calls the DescribeRouteTables operation to query route tables.
This API has been deprecated. We recommend migrating to Vpc(2016-04-28) - DescribeRouteTableList for enhanced functionality and continued support. While the deprecated API remains temporarily accessible, no further updates or bug fixes will be provided.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:DescribeRouteTables |
list |
*RouteTable
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID of the VPC to which the route table belongs. You can call the DescribeRegions operation to query the region ID. |
ap-southeast-6 |
| VRouterId |
string |
No |
The ID of the vRouter to query. Note
You must specify at least one of the following parameters: VRouterId, RouteTableId, RouterId, and RouteTableName. You cannot specify both VRouterId and RouterId at the same time. |
vrt-bp1lhl0taikrteen**** |
| RouteTableId |
string |
No |
The ID of the route table to query. Note
You must specify at least one of the following parameters: VRouterId, RouteTableId, RouterId, and RouteTableName. You cannot specify both VRouterId and RouterId at the same time. |
vtb-bp145q7glnuzdvzu2**** |
| RouterType |
string |
No |
The type of the router to which the route table belongs. Valid values:
|
VRouter |
| RouterId |
string |
No |
The ID of the router to which the route table belongs. Note
You must specify at least one of the following parameters: VRouterId, RouteTableId, RouterId, and RouteTableName. You cannot specify both VRouterId and RouterId at the same time. |
vrt-bp1lhl0taikrteen8**** |
| Type |
string |
No |
The destination type of the route to query. Valid values:
|
Custom |
| RouteTableName |
string |
No |
The name of the route table to query. The name must be 2 to 128 characters in length and must start with a letter or a Chinese character. It can contain digits, periods (.), underscores (_), and hyphens (-). Note
You must specify at least one of the following parameters: VRouterId, RouteTableId, RouterId, and RouteTableName. You cannot specify both VRouterId and RouterId at the same time. |
doctest |
| ResourceGroupId |
string |
No |
The ID of the resource group to which the route table belongs. |
rg-acfmxazb4ph**** |
| PageNumber |
integer |
No |
The page number. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page during paging. Maximum value: 50. Default value: 10. |
10 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The number of entries per page. |
||
| PageSize |
integer |
The number of entries per page. |
10 |
| RequestId |
string |
The request ID. |
DC668356-BCB4-42FD-9BC3-FA2B2E04B634 |
| PageNumber |
integer |
The current page number. |
1 |
| TotalCount |
integer |
The total number of entries returned. |
1 |
| RouteTables |
object |
||
| RouteTable |
array<object> |
The details of the route tables. |
|
|
array<object> |
The time when the route table was created. |
||
| CreationTime |
string |
The time when the route table was created. The time is displayed in the |
2022-08-22T10:40:25Z |
| Status |
string |
The status of the route table. Valid values:
|
Available |
| VRouterId |
string |
The vRouter ID. |
vrt-bp1lhl0taikrteen**** |
| RouteTableType |
string |
The type of the route table. Valid values:
|
Custom |
| ResourceGroupId |
string |
The ID of the resource group to which the route table belongs. |
rg-acfmxazb4ph**** |
| RouteTableId |
string |
The ID of the route table. |
vtb-bp145q7glnuzdvzu2**** |
| RouteEntrys |
object |
||
| RouteEntry |
array<object> |
The information about the route. |
|
|
array<object> |
|||
| Type |
string |
The route type. Valid values:
|
Custom |
| Status |
string |
The route status. Valid values:
|
Available |
| NextHopType |
string |
The type of the next hop. Valid values:
|
Instance |
| RouteEntryName |
string |
The route name. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). |
name |
| RouteEntryId |
string |
The ID of the route. |
rte-bp1mnnr2al0naomnp**** |
| InstanceId |
string |
The ID of the instance associated with the next hop. |
vpc-bp1t36rn9l53iwbsf**** |
| RouteTableId |
string |
The route table ID. |
vtb-bp15w5q90d2rk3bww**** |
| Description |
string |
The description of the route. The description must be 2 to 256 characters in length. It must start with a letter but cannot start with |
RouteEntryDescription |
| DestinationCidrBlock |
string |
The destination CIDR block of the route. The destination CIDR block supports IPv4 and IPv6. Make sure that the destination CIDR block meets the following requirements:
|
192.168.2.0/24 |
| NextHops |
object |
||
| NextHop |
array<object> |
The information about the next hop. |
|
|
object |
|||
| NextHopId |
string |
The ID of the next hop. |
vpn-bp10zyaph5cc8b7c7**** |
| Weight |
integer |
The weight of the route. |
100 |
| NextHopType |
string |
The type of the next hop. Valid values:
|
Instance |
| Enabled |
integer |
Indicates whether the route is available. Valid values:
|
1 |
| VSwitchIds |
object |
||
| VSwitchId |
array |
The vSwitch ID. |
|
|
string |
The vSwitch ID. |
vsw-bp12mw1f8k3jgygk9**** |
Examples
Success response
JSON format
{
"PageSize": 10,
"RequestId": "DC668356-BCB4-42FD-9BC3-FA2B2E04B634",
"PageNumber": 1,
"TotalCount": 1,
"RouteTables": {
"RouteTable": [
{
"CreationTime": "2022-08-22T10:40:25Z",
"Status": "Available",
"VRouterId": "vrt-bp1lhl0taikrteen****",
"RouteTableType": "Custom",
"ResourceGroupId": "rg-acfmxazb4ph****",
"RouteTableId": "vtb-bp145q7glnuzdvzu2****",
"RouteEntrys": {
"RouteEntry": [
{
"Type": "Custom",
"Status": "Available",
"NextHopType": "Instance",
"RouteEntryName": "name",
"RouteEntryId": "rte-bp1mnnr2al0naomnp****",
"InstanceId": "vpc-bp1t36rn9l53iwbsf****",
"RouteTableId": "vtb-bp15w5q90d2rk3bww****",
"Description": "RouteEntryDescription",
"DestinationCidrBlock": "192.168.2.0/24",
"NextHops": {
"NextHop": [
{
"NextHopId": "vpn-bp10zyaph5cc8b7c7****",
"Weight": 100,
"NextHopType": "Instance",
"Enabled": 1
}
]
}
}
]
},
"VSwitchIds": {
"VSwitchId": [
"vsw-bp12mw1f8k3jgygk9****"
]
}
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidVRouterId.NotFound | Specified virtual router does not exist. | |
| 400 | OperationFailed.DescribeCenRoute | An error occurred while querying the CEN route entry. | CEN routes are abnormal. |
| 400 | OperationFailed.VRouterNotExist | Operation failed because the VRouter does not exist. | Operation failed because the VRouter does not exist. |
| 400 | IllegalParam.Type | The parameter of Type is illegal. | Illegal parameter Type. |
| 400 | OperationFailed.InvalidRouterType | The operation is failed because of %s. | Invalid router type. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.