Query routing rules
Updated at:2025-10-16
Description
Retrieve routing rules within a route table or VPC.
Request structure
Plain Text
1GET /v{version}/route/rule?routeTableId={routeTableId}&marker={marker}&maxKeys={maxKeys} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | For API version No., the current value is 1 |
| routeTableId | String | No | Query | Route Table ID, select either this parameter or vpcId |
| vpcId | String | No | Query | VPC ID, select either this parameter or routeTableId |
| marker | String | No | Query | The starting position of the batch list query is a system-generated string |
| maxKeys | Integer | No | Query | Maximum number of items included per page, maximum: 1,000, default: 1,000 |
Description:
The parameters routeTableId and vpcId cannot be used together.
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| marker | String | Mark the starting position of the query. |
| isTruncated | Boolean | true indicates there is more data later, false indicates it is the last page |
| nextMarker | String | Obtain the marker value required for retrieving the next page; this field will not appear when isTruncated is false |
| maxKeys | Integer | Maximum number of items included per page |
| routeRules | List<[RouteRule](VPC/API Reference/Appendix.md#RouteRule)> | List of route rules |
Request example
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
Response example
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}
