获取路由表详情
更新时间:2023-09-20
接口描述
本接口用于获取路由表详情。
请求结构
Plain Text
1GET /v2/route?routeTableId={routeTableId}&vpcId={vpcId} HTTP/1.1
2Host: bec.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
routeTableId | 路由表ID。routeTableId和vpcId不能同时为空。 | query | 否 | string |
vpcId | VPC ID。routeTableId和vpcId不能同时为空。 | query | 否 | string |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名称 | 参数说明 | 类型 |
---|---|---|
routeRules | 路由规则列表 | List<BecRouteRule> |
description | 描述 | string |
destinationAddress | 目的网段 | string |
nexthopId | 下一跳ID | string |
nexthopType | 路由类型:custom:实例路由;system:系统路由;havip:高可用虚拟IP | string |
routeRuleId | 路由规则ID | string |
routeTableId | 路由表ID | string |
sourceAddress | 源网段 | string |
routeTableId | 路由表ID | string |
vpcId | VPC ID | string |
错误码
请参照错误返回章节的内容。
请求示例
Plain Text
1GET /v2/route?routeTableId=rtb-p5vt1kcg HTTP/1.1
2Host: bec.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
响应示例
Plain Text
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3Date: Wed, 08 Jul 2015 03:28:11 GMT
4x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
5Server: BWS
6
7{
8 "routeTableId": "rtb-p5vt1kcg",
9 "vpcId": "vpc-3hg1jtre",
10 "routeRules": [
11 {
12 "routeRuleId": "rtr-1xvorlpg",
13 "routeTableId": "rtb-p5vt1kcg",
14 "sourceAddress": "0.0.0.0/0",
15 "destinationAddress": "172.16.48.0/24",
16 "nexthopId": "local",
17 "nexthopType": "system",
18 "description": "default"
19 },
20 {
21 "routeRuleId": "rtr-nzjubb3n",
22 "routeTableId": "rtb-p5vt1kcg",
23 "sourceAddress": "172.16.48.0/24",
24 "destinationAddress": "172.16.0.0/24",
25 "nexthopId": "vm-z31zuvj3-7-b-singapore-jwtau",
26 "nexthopType": "custom",
27 "description": "test"
28 }
29 ]
30}