Queries route tables.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
vpc:DescribeRouteTables | list | *RouteTable acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId} |
| 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 most recent region list. | cn-hangzhou |
VRouterId | string | No | The ID of the vRouter. | vtb-bp1krxxzp0c29fmon**** |
RouteTableId | string | No | The ID of the route table that you want to query. | rtb-bp12mw1f8k3jgygk9**** |
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. | vtb-bp1krxxzp0c29fmon**** |
Type | string | No | The route type. Valid values:
| custom |
RouteTableName | string | No | The name of the route table that you want to query. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). | RouteTable-1 |
ResourceGroupId | string | No | The ID of the resource group to which the route table to be queried belongs. | rg-acfmxazccb4ph**** |
PageNumber | integer | No | The page number. Default value: 1. | 1 |
PageSize | integer | No | The number of entries per page. Maximum value: 50. Default value: 10. | 10 |
Response parameters
Examples
Sample success responses
JSON
format
{
"PageSize": 10,
"RequestId": "DC668356-BCB4-42FD-9BC3-FA2B2E04B634",
"PageNumber": 1,
"TotalCount": 1,
"RouteTables": {
"RouteTable": [
{
"CreationTime": "2017-08-22T10:40:25Z",
"Status": "Available",
"VRouterId": "vrt-bp1lhl0taikrteen8****",
"RouteTableType": "System",
"ResourceGroupId": "rg-acfmxazb4ph****",
"RouteTableId": "vtb-bp145q7glnuzdvzu2****",
"RouteEntrys": {
"RouteEntry": [
{
"Type": "System",
"Status": "Pending",
"NextHopType": "local",
"RouteEntryName": "test",
"RouteEntryId": "rte-bp1mnnr2al0naomnpxxx",
"InstanceId": "ri-2zeo3xzyf38r4urzd****",
"RouteTableId": "vtb-bp145q7glnuzdvzu2****",
"Description": "RouteEntryDescription",
"DestinationCidrBlock": "192.168.0.1/24",
"NextHops": {
"NextHop": [
{
"NextHopId": "ri-2zeo3xzyf38r4urzdpvqw",
"Weight": 80,
"NextHopType": "HaVip",
"Enabled": 0
}
]
}
}
]
},
"VSwitchIds": {
"VSwitchId": [
"vsw-bp14cagpfysr29fe****"
]
}
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidVRouterId.NotFound | Specified virtual router does not exist. | The specified vRouter does not exist. Check whether the specified vRouter is valid. |
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. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-06-12 | The API operation is deprecated. The Error code has changed | View Change Details |
2023-09-25 | The Error code has changed | View Change Details |
2023-09-06 | The Error code has changed | View Change Details |
2023-08-09 | API Description Update | View Change Details |