All Products
Search
Document Center

Virtual Private Cloud:DescribeRouteTables

Last Updated:Jul 16, 2026

Queries route tables.

Note

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:DescribeRouteTables

list

*RouteTable

acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId}

  • vpc:VBR
  • vpc:VRouter
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.

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.

vtb-bp145q7glnuzdvzu2****

RouterType

string

No

The type of the router to which the route table belongs. Valid values:

  • VRouter (default): vRouter.

  • VBR: Virtual Border Router.

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.

vrt-bp1lhl0taikrteen8****

Type

string

No

The type of the route entry to query. Valid values:

  • Custom: custom route.

  • System: system route.

  • BGP: BGP route.

  • CEN: Cloud Enterprise Network (CEN) route.

  • ECR: Express Connect Router (ECR) route.

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

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 for 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 UTC in the YYYY-MM-DDThh:mm:ssZ format.

2022-08-22T10:40:25Z

Status

string

The status of the route table. Valid values:

  • Pending: being configured.

  • Available: active.

Available

VRouterId

string

The ID of the vRouter.

vrt-bp1lhl0taikrteen****

RouteTableType

string

The type of the route table. Valid values:

  • Custom: custom route table.

  • System: system route table.

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 route information.

array<object>

The route information.

Type

string

The destination type of the route. Valid values:

  • Custom: custom route.

  • System: system route.

  • BGP: BGP route.

  • CEN: Cloud Enterprise Network (CEN) route.

  • ECR: Express Connect Router (ECR) route.

Custom

Status

string

The status of the route. Valid values:

  • Pending: being configured.

  • Available: active.

  • Modifying: being modified.

Available

NextHopType

string

The next hop type. Valid values:

  • Instance (default): ECS instance.

  • HaVip: high-availability virtual IP address.

  • VpnGateway: VPN gateway.

  • NatGateway: NAT gateway.

  • NetworkInterface: secondary elastic network interface controller (NIC).

  • RouterInterface: vRouter interface.

  • IPv6Gateway: IPv6 gateway.

  • Attachment: transit router.

  • Ipv4Gateway: IPv4 gateway.

  • GatewayEndpoint: gateway endpoint.

  • CenBasic: CEN that does not support transit routers.

  • Ecr: Express Connect Router (ECR).

Instance

RouteEntryName

string

The name of the route.

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 (-).

name

RouteEntryId

string

The ID of the route.

rte-bp1mnnr2al0naomnp****

InstanceId

string

The instance ID of the instance associated with the next hop.

vpc-bp1t36rn9l53iwbsf****

RouteTableId

string

The ID of the route table.

vtb-bp15w5q90d2rk3bww****

Description

string

The description of the route. The description must be 2 to 256 characters in length and must start with a letter or a Chinese character. It cannot start with http:// or https://.

RouteEntryDescription

DestinationCidrBlock

string

The destination CIDR block of the route. Both IPv4 and IPv6 destination CIDR blocks are supported. The following requirements must be met:

  • The destination CIDR block cannot point to or be contained within 100.64.0.0/10.

  • The destination CIDR blocks of different routes in the same route table must be unique.

192.168.2.0/24

NextHops

object

NextHop

array<object>

The next hop information.

object

The next hop information.

NextHopId

string

The instance ID of the next hop.

vpn-bp10zyaph5cc8b7c7****

Weight

integer

The weight of the route.

100

NextHopType

string

The next hop type. Valid values:

  • Instance: ECS instance.

  • HaVip: high-availability virtual IP address.

  • VpnGateway: VPN gateway.

  • NatGateway: NAT gateway.

  • NetworkInterface: secondary elastic network interface controller (NIC).

  • RouterInterface: vRouter interface.

  • IPv6Gateway: IPv6 gateway.

  • Attachment: transit router.

  • Ipv4Gateway: IPv4 gateway.

  • GatewayEndpoint: gateway endpoint.

  • CenBasic: CEN that does not support transit routers.

  • Ecr: Express Connect Router (ECR).

Instance

Enabled

integer

Indicates whether the route is available. Valid values:

  • 0: unavailable.

  • 1: available.

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.
400 InvalidParam.RouterInstanceOrRouterId The parameters routerInstanceId and routerId are mutually exclusive. Please use either routerInstanceId alone, or routerType with routerId. The request contains conflicting parameters. You need to provide only routerInstanceId, or both routerType and routerId. Please remove conflicting parameter combinations from the request.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.