Queries route entries in a route table.

Debug

By using API Explorer, you can easily debug APIs, automatically generate SDK code examples, and quickly search for APIs.

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 to be queried belongs.

PageNumber Integer No 10

The number of pages to return. Default value: 1.

PageSize Integer No 10

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

ResourceGroupId String No rg-acfmxazb4ph6aiy

The ID of the resource group.

RouteTableId String No rtb-bp12mw1f8k3jgygk9bmwe

The ID of the route table.

RouteTableName String No RouteTable-1

The name of the route table.

RouterId String No vtb-bp1krxxzp0c29fmontbal

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

RouterType String No VRouter

The type of the router to which the route table to be queried belongs. Valid value:

  • VRouter: VRouter

  • VBR: VBR

Type String No custom

The type of the route table.

VRouterId String No vtb-bp1krxxzp0c29fmontbal

The ID of the VRouter to which the route table to be queried belongs. The value of the RouterType parameter is set to VRouter automatically when this parameter is specified.

Response parameters

Parameter Type Example value Description
RouteTables N/A N/A

A list of route tables.

 └RouteTableId String vtb-bp145q7glnuzdvzu21pom

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

 └CreationTime String 2017-08-22T10:40:25Z

The time when the route table was created.

 └ResourceGroupId String rg-acfmxazb4ph6aiy

The ID of the resource group.

 └RouteEntrys N/A N/A

A list of route entries.

 └RouteTableId String vtb-bp145q7glnuzdvzu21pom

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

 └DestinationCidrBlock String 192.168.0.1/24

The destination CIDK block of the route entry.

 └Type String System

The type of the route entry. Valid values:

  • System: system route
  • Custom: custom route
  • BGP: BGP route
 └NextHopType String HaVip

The type of the next hop. Valid values:

  • Instance: ECS instance (default)
  • HaVip: HaVip
  • RouterInterface: router interface
 └Status String Pending

The status of the route entry. Valid values:

  • Pending: being configured
  • Available: available
  • Modifying: being modified
 └InstanceId String ri-2zeo3xzyf38r4urzdpvfs

The instance ID of the next hop.

 └NextHops N/A N/A

A list of next hops of ECMP routes.

 └NextHopType String HaVip

The type of the next hop. Valid values:

  • Instance: ECS instance (default)
  • HaVip: HaVip
  • RouterInterface: router interface
 └NextHopId String ri-2zeo3xzyf38r4urzdpvqw

The instance ID of the next hop.

 └Enabled Integer 0

Whether to enable the next hop.

  • 0: disabled
  • 1: enabled
 └Weight Integer 80

The routing weight of the next hop.

 └RouteTableType String System

The type of the route table to be queried.

 └VRouterId String vrt-bp1lhl0taikrteen80oxx

The ID of the VRouter.

 └VSwitchIds N/A vsw-bp14cagpfysr29feg5t97

A list of VSwitches under the VPC.

TotalCount Integer 12

The number of queried entries.

PageNumber Integer 1

The current page number.

PageSize Integer 1

The number of entries per page.

RequestId String DC668356-BCB4-42FD-9BC3-FA2B2E04B634

The ID of the request.

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/>
              <Status>Available</Status>
              <Type>Custom</Type>
              <InstanceId>ri-2zeo3xzyf38r4urzdpvfs</InstanceId>
              <NextHopType>RouterInterface</NextHopType>
              <RouteTableId>vtb-2zevpmy9th8cxmwtarqg4</RouteTableId>
              <DestinationCidrBlock>10.10.0.0/24</DestinationCidrBlock>
            </RouteEntry>
            <RouteEntry>
              <NextHops/>
              <Status>Available</Status>
              <Type>System</Type>
              <InstanceId/>
              <NextHopType>service</NextHopType>
              <RouteTableId>vtb-2zevpmy9th8cxmwtarqg4</RouteTableId>
              <DestinationCidrBlock>100.64.0.0/10</DestinationCidrBlock>
            </RouteEntry>
          </RouteEntrys>
          <RouteTableId>vtb-2zevpmy9th8cxmwtarqg4</RouteTableId>
          <RouteTableType>System</RouteTableType>
          <VRouterId>vrt-2zefso23vmu6xi3jeiw0z</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":[
    						{
    							"Status":"Available",
    							"NextHops":{
    								"NextHop":[]
    							},
    							"Type":"Custom",
    							"InstanceId":"ri-2zeo3xzyf38r4urzdpvfs",
    							"RouteTableId":"vtb-2zevpmy9th8cxmwtarqg4",
    							"NextHopType":"RouterInterface",
    							"DestinationCidrBlock":"10.10.0.0/24"
    						},
    						{
    							"Status":"Available",
    							"NextHops":{
    								"NextHop":[]
    							},
    							"Type":"System",
    							"InstanceId":"",
    							"RouteTableId":"vtb-2zevpmy9th8cxmwtarqg4",
    							"NextHopType":"service",
    							"DestinationCidrBlock":"100.64.0.0/10"
    						}
    					]
    				},
    				"RouteTableId":"vtb-2zevpmy9th8cxmwtarqg4",
    				"VRouterId":"vrt-2zefso23vmu6xi3jeiw0z",
    				"RouteTableType":"System"
    			}
    		]
    	}
    }

Error codes

See common error codes