调用DescribeVpnRouteEntries接口查询VPN网关实例的目的路由条目信息和BGP路由条目信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
vpc:DescribeVpnRouteEntries |
get |
*VpnGateway
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
是 |
VPN 网关实例所在的地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。 |
cn-hangzhou |
| VpnGatewayId |
string |
是 |
VPN 网关的实例 ID。 |
vpn-bp1cmw7jh1nfe43m9**** |
| PageNumber |
integer |
否 |
列表的页码。默认值:1。 |
1 |
| PageSize |
integer |
否 |
分页查询时每页的行数。最大值:50。默认值:10。 |
10 |
| RouteEntryType |
string |
否 |
路由条目的类型。取值:
|
custom |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回结果。 |
||
| PageSize |
integer |
分页查询时每页的行数。 |
10 |
| RequestId |
string |
请求 ID。 |
BF3995A6-FA4F-4C74-B90F-89ECF4BFF4D5 |
| PageNumber |
integer |
列表的页码。 |
1 |
| TotalCount |
integer |
列表总条目数。 |
1 |
| VpnRouteEntries |
object |
||
| VpnRouteEntry |
array<object> |
路由条目信息列表。 |
|
|
object |
路由条目详细信息。 |
||
| RouteEntryType |
string |
路由条目的类型。
|
custom |
| NextHop |
string |
路由条目的下一跳。 |
vco-bp1tui07ob10fmuro**** |
| Weight |
integer |
目的路由的权重值。
|
100 |
| RouteDest |
string |
路由条目的目标网段。 |
10.0.0.0/24 |
| AsPath |
string |
路由条目经过的 AS 路径。 |
65501,65001,60011 |
| State |
string |
路由条目的状态。取值:
|
normal |
| CreateTime |
integer |
创建路由条目的时间戳。 时间戳的格式采用 Unix 时间戳,表示从格林威治时间 1970 年 01 月 01 日 00 时 00 分 00 秒至创建路由条目时的总时长。 |
1563874074000 |
| Community |
string |
路由条目的 Community 属性值。 |
65001:1000,65501:2000 |
| Source |
string |
BGP 路由条目的来源。
|
CLOUD |
| VpnInstanceId |
string |
VPN 网关实例 ID。 |
vpn-bp1cmw7jh1nfe43m9**** |
| NextHopTunnelId |
string |
路由条目下一跳关联的隧道 ID。 说明
仅支持双隧道模式 IPsec-VPN 连接的 VPN 网关实例会返回当前参数。 |
tun-36cfgpwjn58axj**** |
| VpnRouteCounts |
object |
||
| VpnRouteCount |
array<object> |
双隧道模式 VPN 网关实例的路由条目统计信息。 说明
仅支持双隧道模式 IPsec-VPN 连接的 VPN 网关实例会返回该组信息。 |
|
|
object |
路由条目的统计信息。 |
||
| RouteEntryType |
string |
路由条目类型。
|
bgp |
| RouteCount |
integer |
路由条目数量。 |
3 |
| Source |
string |
BGP 路由条目的来源。
|
VPN_BGP |
示例
正常返回示例
JSON格式
{
"PageSize": 10,
"RequestId": "BF3995A6-FA4F-4C74-B90F-89ECF4BFF4D5",
"PageNumber": 1,
"TotalCount": 1,
"VpnRouteEntries": {
"VpnRouteEntry": [
{
"RouteEntryType": "custom",
"NextHop": "vco-bp1tui07ob10fmuro****",
"Weight": 100,
"RouteDest": "10.0.0.0/24",
"AsPath": "65501,65001,60011",
"State": "normal",
"CreateTime": 1563874074000,
"Community": "65001:1000,65501:2000",
"Source": "CLOUD",
"VpnInstanceId": "vpn-bp1cmw7jh1nfe43m9****",
"NextHopTunnelId": "tun-36cfgpwjn58axj****"
}
]
},
"VpnRouteCounts": {
"VpnRouteCount": [
{
"RouteEntryType": "bgp",
"RouteCount": 3,
"Source": "VPN_BGP"
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | IllegalParam.RouteEntryType | The specified "RouteEntryType" is invalid. | |
| 400 | InvalidVpnInstanceId.NotFound | The specified VPN was not found. | 指定的VPN实例未找到。 |
| 400 | InvalidVpnGatewayInstanceId.NotFound | The specified vpn gateway instance id does not exist. | 指定的 VPN 网关不存在,请您检查 VPN 网关是否正确。 |
| 403 | Forbbiden.SubUser | User not authorized to operate on the specified resource as your account is created by another user. | |
| 403 | Forbidden | User not authorized to operate on the specified resource. | 您没有权限操作指定资源,请申请权限后再操作。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。