查询路由规则
更新时间:2024-12-30
描述
查询路由表或VPC下的路由规则。
请求结构
Plain Text
1GET /v{version}/route/rule?routeTableId={routeTableId}&marker={marker}&maxKeys={maxKeys} 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两者之间需要二选一 |
marker | String | 否 | Query参数 | 批量获取列表的查询的起始位置,是一个由系统生成的字符串 |
maxKeys | Integer | 否 | Query参数 | 每页包含的最大数量,最大数量不超过1000,缺省值为1000 |
说明:
请求参数routeTableId和vpcId二选一。
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 描述 |
---|---|---|
marker | String | 标记查询的起始位置 |
isTruncated | Boolean | true表示后面还有数据,false表示已经是最后一页 |
nextMarker | String | 获取下一页所需要传递的marker值;当isTruncated为false时,该域不出现 |
maxKeys | Integer | 每页包含的最大数量 |
routeRules | List<RouteRule> | 路由规则列表 |
请求示例
Plain Text
1GET /v1/route/rule?routeTableId=rt-q1zg3i8mx8p6&marker=rr-dvq3cxpghw5e&maxKeys=1000 HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: 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 "nextMarker": "rr-rbn5yyz6rtn8",
8 "marker": "rr-dvq3cxpghw5e",
9 "maxKeys": 1000,
10 "isTruncated": true,
11 "routeRules": [{
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 "nexthopType": "vpn"
19 },
20 {
21 "routeTableId": "rt-q1zg3i8mx8p6",
22 "description": "",
23 "nexthopId": "",
24 "destinationAddress": "192.168.0.0/20",
25 "sourceAddress": "0.0.0.0/0",
26 "routeRuleId": "rt-2e9fi8chbxvh",
27 "nexthopType": "sys"
28 },
29 {
30 "routeTableId": "rt-q1zg3i8mx8p6",
31 "description": "",
32 "nexthopId": "",
33 "destinationAddress": "192.168.0.0/20",
34 "sourceAddress": "0.0.0.0/0",
35 "routeRuleId": "rr-rbn5yyz6rtn8",
36 "nexthopType": "sys"
37 }
38 ]
39}