调用DescribeRouteTables接口查询路由表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeRouteTables | 要执行的操作,取值:DescribeRouteTables。 |
RegionId | String | 是 | cn-hangzhou | 要查询的路由表所属的VPC的地域ID。 |
VRouterId | String | 否 | vtb-bp1krxxzp0c29fmon**** | 要查询的路由表所属的VPC路由器的ID。 指定该参数后,RouterType参数的值自动设置为VRouter。 |
RouteTableId | String | 否 | rtb-bp12mw1f8k3jgygk9**** | 要查询的路由表的ID。 |
RouterType | String | 否 | VRouter | 路由表所属的路由器类型,取值:
|
RouterId | String | 否 | vtb-bp1krxxzp0c29fmon**** | 路由表所属的VPC路由器或边界路由器的ID。 |
Type | String | 否 | custom | 要查询的路由表的类型,取值:
|
RouteTableName | String | 否 | RouteTable-1 | 要查询的路由表的名称。 |
ResourceGroupId | String | 否 | rg-acfmxazccb4ph**** | 路由表所属的资源组的ID。 |
PageNumber | Integer | 否 | 1 | 列表的页码,默认值为1。 |
PageSize | Integer | 否 | 10 | 分页查询时每页的行数,最大值为50,默认值为10。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RouteTables | Array | 路由表的详细信息。 |
|
RouteTable | |||
RouteTableId | String | vtb-bp145q7glnuzdvzu2**** | 路由条目所属路由表的ID。 |
CreationTime | String | 2017-08-22T10:40:25Z | 路由表的创建时间。 |
ResourceGroupId | String | rg-acfmxazb4ph**** | 路由表所属的资源组的ID。 |
RouteEntrys | Array | 路由条目的详细信息。 |
|
RouteEntry | |||
RouteTableId | String | vtb-bp145q7glnuzdvzu2**** | 路由条目所属路由表的ID。 |
DestinationCidrBlock | String | 192.168.0.1/24 | 路由条目的目标网段。 |
Type | String | System | 路由条目的类型。
|
NextHopType | String | local | 路由类型。
|
Status | String | Pending | 路由条目的状态。
|
Description | String | RouteEntryDescription | 路由条目的描述信息。 |
InstanceId | String | ri-2zeo3xzyf38r4urzd**** | 下一跳的实例ID。 |
NextHops | Array | ECMP路由的下一跳列表。 |
|
NextHop | |||
NextHopType | String | HaVip | 下一跳的类型。
|
NextHopId | String | ri-2zeo3xzyf38r4urzdpvqw | 下一跳实例的ID。 |
Enabled | Integer | 0 | 是否启用下一跳。
|
Weight | Integer | 80 | 下一跳的路由权重。 |
RouteEntryId | String | rte-bp1mnnr2al0naomnpxxx | 路由条目ID。 |
RouteEntryName | String | test | 路由条目名称。 |
RouteTableType | String | System | 路由表的类型。
|
Status | String | Available | 路由表的状态。
|
VRouterId | String | vrt-bp1lhl0taikrteen8**** | VPC路由器的ID。 |
VSwitchIds | List | vsw-bp14cagpfysr29fe**** | VPC下的交换机列表。 |
TotalCount | Integer | 1 | 列表条目数。 |
PageNumber | Integer | 1 | 当前页码。 |
PageSize | Integer | 10 | 每页包含的条目数。 |
RequestId | String | DC668356-BCB4-42FD-9BC3-FA2B2E04B634 | 请求ID。 |
示例
请求示例
1 2 | http(s): //vpc.aliyuncs.com/?Action=DescribeRouteTables &<公共请求参数> |
正常返回示例
XML
格式
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | <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
格式
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | { "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****" } ] } } |
错误码
访问错误中心查看更多错误码。