查询路由表
更新时间:2024-12-30
描述
查询所有路由表。
请求结构
Plain Text
1GET /v{version}/route?routeTableId={routeTableId} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
---|---|---|---|---|
version | String | 是 | URL参数 | API版本号,当前取值为1 |
routeTableId | String | 否 | Query参数 | 路由表ID,该参数和vpcId两者之间二选一 |
vpcId | String | 否 | Query参数 | VPC的ID,该参数和routeTableId两者之间二选一 |
说明:
请求参数routeTableId和vpcId不可以同时为空。
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 描述 |
---|---|---|
name | String | 路由表名称 |
routeTableId | String | 路由表ID |
vpcId | String | VPC的ID |
routeRules | List<RouteRule> | 路由规则列表 |
请求示例
Plain Text
1GET /v1/route?routeTableId=rt-q1zg3i8mx8p6 HTTP/1.1
2Host: bcc.bj.baidubce.com
3Content-Type: application/json;charset=UTF-8
4Authorization: bce-auth-v1/5a6f0606bf5e48f29dd132aa76aa5182/2017-06-12T11:57:26Z/1800/content-type;host;x-bce-date/fd0ba5a693691a50352cb77f4b41cd845ac1a29176398035612a4dde43502982
返回示例
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 6607c593-0628-4a6f-a10f-d7747312538b
3Date: Mon, 12 Jun 2017 11:57:32 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6{
7 "name": "default",
8 "routeTableId": "rt-q1zg3i8mx8p6",
9 "vpcId": "vpc-56rj0s4ha42a",
10 "routeRules": [
11 {
12 "routeTableId": "rt-q1zg3i8mx8p6",
13 "description": "",
14 "nexthopId": "vpn-snx074964j9d",
15 "destinationAddress": "10.0.0.1/32",
16 "sourceAddress": "192.168.0.0/20",
17 "routeRuleId": "rr-dvq3cxpghw5e",
18 "pathType": "normal",
19 "nexthopType": "vpn"
20 },
21 {
22 "routeTableId": "rt-q1zg3i8mx8p6",
23 "description": "",
24 "nexthopId": "",
25 "destinationAddress": "192.168.0.0/20",
26 "sourceAddress": "0.0.0.0/0",
27 "routeRuleId": "",
28 "pathType": "normal",
29 "nexthopType": "sys"
30 },
31 {
32 "routeTableId": "rt-q1zg3i8mx8p6",
33 "description": "",
34 "nexthopId": "",
35 "destinationAddress": "192.168.0.0/20",
36 "sourceAddress": "0.0.0.0/0",
37 "routeRuleId": "",
38 "pathType": "normal",
39 "nexthopType": "sys"
40 }
41 ]
42}