Query Route Table
Last Updated:2020-07-20
Description
Query all route tables.
Request Structure
GET /v{version}/route?routeTableId={routeTableId} HTTP/1.1
Host: bcc.bj.baidubce.com
Authorization: authorization string
Request Header
There are no other special headers except the public headers.
Request Parameter
Parameter name | Type | Required or not | Parameter position | Description |
---|---|---|---|---|
version | String | Yes | URL parameter | API version number |
routeTableId | String | No | Query parameter | Either the route table id or the vpcId should be selected. |
vpcId | String | No | Query parameter | Either the id of VPC or the routeTableId should be selected. |
Note:
The request parameter routeTableId and vpcId cannot be simultaneously empty.
Return Header
There are no other special headers except the public headers.
Return Parameter
Parameter name | Type | Description |
---|---|---|
routeTableId | String | Route table id |
vpcId | String | VPCid |
routeRules | RouteRule | Route rule list |
Request Example
GET /v1/route?routeTableId=rt-q1zg3i8mx8p6 HTTP/1.1
Host: bcc.bj.baidubce.com
Authorization: bce-auth-v1/5a6f0606bf5e48f29dd132aa76aa5182/2017-06-12T11:57:26Z/1800/content-type;host;x-bce-date/fd0ba5a693691a50352cb77f4b41cd845ac1a29176398035612a4dde43502982
Return Example
HTTP/1.1 200 OK
x-bce-request-id: 6607c593-0628-4a6f-a10f-d7747312538b
Date: Mon, 12 Jun 2017 11:57:32 GMT
Content-Type: application/json;charset=UTF-8
Server: BWS
{
"routeTableId": "rt-q1zg3i8mx8p6",
"vpcId": "vpc-56rj0s4ha42a",
"routeRules": [
{
"routeTableId": "rt-q1zg3i8mx8p6",
"description": "",
"nexthopId": "vpn-snx074964j9d",
"destinationAddress": "10.0.0.1/32",
"sourceAddress": "192.168.0.0/20",
"routeRuleId": "rr-dvq3cxpghw5e",
"nexthopType": "vpn"
},
{
"routeTableId": "rt-q1zg3i8mx8p6",
"description": "",
"nexthopId": "",
"destinationAddress": "192.168.0.0/20",
"sourceAddress": "0.0.0.0/0",
"routeRuleId": "",
"nexthopType": "sys"
},
{
"routeTableId": "rt-q1zg3i8mx8p6",
"description": "",
"nexthopId": "",
"destinationAddress": "192.168.0.0/20",
"sourceAddress": "0.0.0.0/0",
"routeRuleId": "",
"nexthopType": "sys"
}
]
}