Queries one or more route tables.

Make the API call

You can use OpenAPI Explorer to make API calls, search for API calls, perform debugging, and generate SDK example code.

Request parameters

Parameter Type Required? Example value Description
Action String Yes DescribeRouteTables

The name of this action. Value: DescribeRouteTables

RegionId String Yes cn-hangzhou

The region ID of the VPC to which the route table belongs.

VRouterId String No vtb-bp1krxxzp0c29fmon****

The ID of the VRouter to which the route table belongs.

The value of the RouterType parameter is set to VRouter automatically when this parameter is specified.

RouteTableId String No rtb-bp12mw1f8k3jgygk9****

The ID of the route table to query.

RouterType String No VRouter

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

  • VRouter: VRouter
  • VBR: Virtual Border Router (VBR)
RouterId String No vtb-bp1krxxzp0c29fmon****

The ID of the VRouter or VBR to which the route table belongs.

Type String No custom

The type of the route table.

  • System: System route table
  • Custom: Cusotm route table
  • BGP: BGP route
RouteTableName String No RouteTable-1

The name of the route table.

ResourceGroupId String No rg-acfmxazccb4ph****

The ID of the resource group to which the route table belongs.

PageNumber Integer No 1

The page number. Default value: 1.

PageSize Integer No 10

The number of rows per page. Maximum value: 50. Default value: 10.

Response parameters

Parameter Type Example value Description
RequestId String DC668356-BCB4-42FD-9BC3-FA2B2E04B634

The ID of the request.

TotalCount Integer 1

The total number of entries.

PageNumber Integer 1

The current page number.

PageSize Integer 10

The number of entries per page.

RouteTables Array

Details of route tables.

VRouterId String vrt-bp1lhl0taikrteen8****

The ID of the VRouter.

RouteTableId String vtb-bp145q7glnuzdvzu2****

The ID of the route table to which the route entry belongs.

RouteTableType String System

The type of the route table.

  • System: System route table
  • Custom: Custom route table
CreationTime String 2017-08-22T10:40:25Z

The time at which the route table was created.

ResourceGroupId String rg-acfmxazb4ph****

The ID of the resource group to which the route table belongs.

Status String Available

The status of the route table.

  • Pending: The route table is being configured.
  • Available: The route table is available.
RouteEntrys Array

Details of route entries.

RouteTableId String vtb-bp145q7glnuzdvzu2****

The ID of the route table to which the route entry belongs.

DestinationCidrBlock String 192.168.0.1/24

The destination CIDR block of the route entry.

Type String System

The type of the route entry.

  • System: System route entry
  • Custom: Custom route entry
  • BGP: BGP route entry
Status String Pending

The status of the route entry.

  • Pending: The route entry is being configured.
  • Available: The route entry is available.
  • Modifying: The route entry is being modified.
InstanceId String ri-2zeo3xzyf38r4urzd****

The ID of the next-hop instance.

NextHopType String local

The type of the route.

  • local: VSwitch route
  • Service: Cloud service route
  • classicLink: The route automatically added by the system after the ClassicLink function is enabled.
RouteEntryName String test

The name of the route entry.

RouteEntryId String rte-bp1mnnr2al0naomnpxxx

The ID of the route entry.

NextHops Array

The next hop list of the ECMP route.

NextHopType String HaVip

The type of the next-hop address.

  • Instance: ECS instance
  • HaVip: High-Availability Virtual IP Address (HaVip)
  • VpnGateway: VPN Gateway
  • NatGateway: NAT Gateway
  • NetworkInterface: Secondary Elastic Network Interface
  • RouterInterface: Router interface
  • IPv6Gateway: IPv6 Gateway
NextHopId String ri-2zeo3xzyf38r4urzdpvqw

The ID of the next-hop instance.

Enabled Integer 0

Indicates whether the next hop is enabled.

  • 0: Disable the next hop.
  • 1: Enable the next hop.
Weight Integer 80

The routing weight of the next hop.

VSwitchIds List vsw-bp14cagpfysr29fe****

A list of VSwitches in the VPC.

Examples

Request example

http(s)://vpc.aliyuncs.com/? Action=DescribeRouteTables
&<CommonParameters>

Response example

XML format

<DescribeRouteTablesResponse>
	  <PageNumber>1</PageNumber>
	  <TotalCount>1</TotalCount>
	  <PageSize>10</PageSize>
	  <RequestId>DC668356-BCB4-42FD-9BC3-FA2B2E04B634</RequestId>
	  <RouteTables>
		    <RouteTable>
			      <CreationTime>2017-08-22T10:40:25Z</CreationTime>
			      <RouteEntrys>
				        <RouteEntry>
					          <NextHops></NextHops>
					          <Status>Available</Status>
					          <Type>Custom</Type>
					          <InstanceId>ri-2zeo3xzyf38r4urzd****</InstanceId>
					          <NextHopType>RouterInterface</NextHopType>
					          <RouteTableId>vtb-2zevpmy9th8cxmwta****</RouteTableId>
					          <DestinationCidrBlock>10.10.0.0/24</DestinationCidrBlock>
				        </RouteEntry>
				        <RouteEntry>
					          <NextHops></NextHops>
					          <Status>Available</Status>
					          <Type>System</Type>
					          <InstanceId></InstanceId>
					          <NextHopType>service</NextHopType>
					          <RouteTableId>vtb-2zevpmy9th8cxmwta****</RouteTableId>
					          <DestinationCidrBlock>100.64.0.0/10</DestinationCidrBlock>
				        </RouteEntry>
			      </RouteEntrys>
			      <RouteTableId>vtb-2zevpmy9th8cxmwta****</RouteTableId>
			      <RouteTableType>System</RouteTableType>
			      <VRouterId>vrt-2zefso23vmu6xi3je****</VRouterId>
		    </RouteTable>
	  </RouteTables>
</DescribeRouteTablesResponse>

JSON format

{
    "PageNumber": 1,
    "TotalCount": 1,
    "PageSize": 10,
    "RequestId": "DC668356-BCB4-42FD-9BC3-FA2B2E04B634",
    "RouteTables": {
        "RouteTable": [
            {
                "CreationTime": "2017-08-22T10:40:25Z",
                "RouteEntrys": {
                    "RouteEntry": [
                        {
                            "NextHops": {
                                "NextHop": []
                            },
                            "Status": "Available",
                            "Type": "Custom",
                            "InstanceId": "ri-2zeo3xzyf38r4urzd****",
                            "NextHopType": "RouterInterface",
                            "RouteTableId": "vtb-2zevpmy9th8cxmwta****",
                            "DestinationCidrBlock": "10.10.0.0/24"
                        },
                        {
                            "NextHops": {
                                "NextHop": []
                            },
                            "Status": "Available",
                            "Type": "System",
                            "InstanceId": "",
                            "NextHopType": "service",
                            "RouteTableId": "vtb-2zevpmy9th8cxmwta****",
                            "DestinationCidrBlock": "100.64.0.0/10"
                        }
                    ]
                },
                "RouteTableId": "vtb-2zevpmy9th8cxmwt****",
                "RouteTableType": "System",
                "VRouterId": "vrt-2zefso23vmu6xi3je****"
            }
        ]
    }
}

Errors

For a list of error codes, visit the API Error Center.