调用DescribeRouteEntryList接口查询路由条目列表。
使用说明
调用DeleteRouteEntry接口删除路由条目前,您可以调用本接口查询要删除的路由条目的下一跳信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
RegionId | String | 是 | cn-hangzhou | 路由条目所在路由表的地域ID。 您可以通过调用DescribeRegions接口获取地域ID。 |
RouteTableId | String | 是 | vtb-bp1r9pvl4xen8s9ju**** | 要查询的路由表的ID。 |
RouteEntryId | String | 否 | rte-bp1mnnr2al0naomnp**** | 要查询的路由条目的ID。 |
DestinationCidrBlock | String | 否 | 192.168.2.0/24 | 路由条目的目标网段,支持IPv4和IPv6网段。 |
RouteEntryName | String | 否 | abc | 路由条目的名称。 名称长度为1~128个字符,不能以 |
IpVersion | String | 否 | IPv4 | IP协议的版本。取值:
|
RouteEntryType | String | 否 | System | 路由条目的类型。取值:
|
NextHopId | String | 否 | vpn-bp10zyaph5cc8b7c7**** | 下一跳实例ID。 |
NextHopType | String | 否 | Instance | 下一跳类型。取值:
|
MaxResult | Integer | 否 | 10 | 分批次查询时每次显示的条目数。取值范围:1~100,默认值为10。 |
NextToken | String | 否 | FFmyTO70tTpLG6I3FmYAXGKPd**** | 是否拥有下一次查询的令牌(Token)。取值:
|
Action | String | 是 | DescribeRouteEntryList | 系统规定参数。取值:DescribeRouteEntryList。 |
ServiceType | String | 否 | TR | 路由托管的类型。如果该字段为空,即表示该路由没有被托管。 取值:TR,表示托管类型为转发路由器类型。 |
DestCidrBlockList.N | String | 否 | 192.168.0.0/24 | 路由条目的目标网段列表信息。最多支持输入20个目标网段。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
NextToken | String | FFmyTO70tTpLG6I3FmYAXGKPd**** | 是否拥有下一次查询的令牌(Token)。取值:
|
RequestId | String | 14A07460-EBE7-47CA-9757-12CC4761D47A | 请求ID。 |
RouteEntrys | Array of RouteEntry | 路由条目信息。 |
|
RouteEntry | |||
Status | String | Available | 路由条目的状态。取值:
|
Type | String | Custom | 路由条目的类型。取值:
|
IpVersion | String | IPv4 | IP协议的版本。取值:
|
Description | String | RouteEntryDescription | 路由条目的描述信息。 |
RouteEntryName | String | aaa | 路由条目的名称。 |
DestinationCidrBlock | String | 192.168.2.0/24 | 路由条目的目标网段。 |
RouteEntryId | String | rte-bp1mnnr2al0naomnp**** | 路由条目的ID。 |
RouteTableId | String | vtb-bp15w5q90d2rk3bww**** | 路由表ID。 |
GmtModified | String | 2022-05-09T03:00:07Z | 路由条目的修改时间。使用UTC时间,格式为 |
NextHops | Array of NextHop | 下一跳信息。 |
|
NextHop | |||
NextHopRegionId | String | cn-hangzhou | 下一跳实例所在的地域ID。 说明 下一跳类型为RouterInterface时返回该参数。 |
Weight | Integer | 100 | 路由条目的权重。 说明 下一跳类型为RouterInterface时返回该参数。 |
NextHopId | String | vpn-bp10zyaph5cc8b7c7**** | 下一跳实例ID。 |
Enabled | Integer | 1 | 路由是否可用。取值:
说明 下一跳类型为RouterInterface时返回该参数。 |
NextHopType | String | Instance | 下一跳类型。取值:
|
NextHopRelatedInfo | Object | 下一跳相关信息。 |
|
InstanceId | String | vpc-bp1t36rn9l53iwbsf**** | 与下一跳相关联实例的实例ID。 |
InstanceType | String | VPC | 与下一跳相关联实例的实例类型。取值:
|
RegionId | String | ch-hangzhou | 下一跳相关联实例所在的地域ID。 |
ServiceType | String | TR | 路由托管的类型。如果该字段为空,即表示该路由没有被托管。 取值:TR,表示托管类型为转发路由器类型。 |
示例
请求示例
http(s)://[Endpoint]/?RegionId=cn-hangzhou
&RouteTableId=vtb-bp1r9pvl4xen8s9ju****
&RouteEntryId=rte-bp1mnnr2al0naomnp****
&DestinationCidrBlock=192.168.2.0/24
&RouteEntryName=abc
&IpVersion=IPv4
&RouteEntryType=System
&NextHopId=vpn-bp10zyaph5cc8b7c7****
&NextHopType=Instance
&MaxResult=10
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&Action=DescribeRouteEntryList
&ServiceType=TR
&DestCidrBlockList=["192.168.0.0/24"]
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeRouteEntryListResponse>
<NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
<RequestId>14A07460-EBE7-47CA-9757-12CC4761D47A</RequestId>
<RouteEntrys>
<Status>Available</Status>
<Type>Custom</Type>
<IpVersion>IPv4</IpVersion>
<Description>RouteEntryDescription</Description>
<RouteEntryName>aaa</RouteEntryName>
<DestinationCidrBlock>192.168.2.0/24</DestinationCidrBlock>
<RouteEntryId>rte-bp1mnnr2al0naomnp****</RouteEntryId>
<RouteTableId>vtb-bp15w5q90d2rk3bww****</RouteTableId>
<GmtModified>2022-05-09T03:00:07Z</GmtModified>
<NextHops>
<NextHopRegionId>cn-hangzhou</NextHopRegionId>
<Weight>100</Weight>
<NextHopId>vpn-bp10zyaph5cc8b7c7****</NextHopId>
<Enabled>1</Enabled>
<NextHopType>Instance</NextHopType>
<NextHopRelatedInfo>
<InstanceId>vpc-bp1t36rn9l53iwbsf****</InstanceId>
<InstanceType>VPC</InstanceType>
<RegionId>ch-hangzhou</RegionId>
</NextHopRelatedInfo>
</NextHops>
<ServiceType>TR</ServiceType>
</RouteEntrys>
</DescribeRouteEntryListResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd****",
"RequestId" : "14A07460-EBE7-47CA-9757-12CC4761D47A",
"RouteEntrys" : [ {
"Status" : "Available",
"Type" : "Custom",
"IpVersion" : "IPv4",
"Description" : "RouteEntryDescription",
"RouteEntryName" : "aaa",
"DestinationCidrBlock" : "192.168.2.0/24",
"RouteEntryId" : "rte-bp1mnnr2al0naomnp****",
"RouteTableId" : "vtb-bp15w5q90d2rk3bww****",
"GmtModified" : "2022-05-09T03:00:07Z",
"NextHops" : [ {
"NextHopRegionId" : "cn-hangzhou",
"Weight" : 100,
"NextHopId" : "vpn-bp10zyaph5cc8b7c7****",
"Enabled" : 1,
"NextHopType" : "Instance",
"NextHopRelatedInfo" : {
"InstanceId" : "vpc-bp1t36rn9l53iwbsf****",
"InstanceType" : "VPC",
"RegionId" : "ch-hangzhou"
}
} ],
"ServiceType" : "TR"
} ]
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | OperationFailed.QueryCenEntry | Operation is denied because getting CEN route entry has failed. | 由于暂时无法获取云企业网路由导致查询失败。 |
400 | OperationDenied.UseGatewayRouteEntryQueryInterface | Use listGatewayRouteTableEntries to describe gateway route entries. | 查询网关路由表路由条目,请使用listGatewayRouteTableEntries接口。 |
访问错误中心查看更多错误码。