Query routing entries of a TGW
Updated at:2025-11-11
Description
Query the routing entries of a specific TGW.
Request structure
Plain Text
1GET /v{version}/csn/{csnId}/tgw/{tgwId}/rule?marker={marker}&maxKeys={maxKeys} HTTP/1.1
2Host: csn.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Type | Is it required | Parameter position | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| csnId | String | Yes | URL parameter | Cloud Smart Network ID |
| tgwId | String | Yes | URL parameter | ID of the TGW |
| 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 |
Response headers
No additional headers beyond standard ones.
Response parameters
| Parameter name | Type | Description |
|---|---|---|
| tgwRtRules | List <[TgwRtRule](#CSN/API Reference/Appendix.md#TgwRtRule)> | List of TGW routing entries |
| marker | String | Marker indicating the starting position of the query. If the result list is empty, this field does not exist. |
| 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 |
Request example
Plain Text
1GET /v1/csn/csn-c5s0isempeiscgyc/tgw/tgw-2vz7tre06hxei9rj/rule?marker=tgw-qhxx0kmm0t86vmpk&maxKeys=1 HTTP/1.1
2Host: csn.baidubce.com
3Authorization: bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02
Response example
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Thu, 16 Mar 2017 06:29:48 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6{
7 "nextMarker": "tgw-jkxx0kmm0t86vkfk",
8 "marker": "tgw-qhxx0kmm0t86vmpk",
9 "maxKeys": 1,
10 "isTruncated": true,
11 "tgwRtRules": [
12 {
13 "ruleId": "cnrr-1db26d78-1781",
14 "routeType": "custom",
15 "csnId": "csn-m3dwj6tfysnmxmcy",
16 "csnRtId": "csnRt-w3x16fk8nr5kpxkx",
17 "fromAttachId": "tgwAttach-wg3z1z5baq3ry1a6",
18 "status": "conflicted",
19 "destAddress": "192.168.0.0/20",
20 "nextHopId": "vpc-fh43ygs8yp0d",
21 "nextHopName": "Default Virtual Private Cloud",
22 "nextHopRegion": "su",
23 "nextHopType": "vpc",
24 "asPath": "",
25 "community": "",
26 "blackHole": false
27 }
28 ]
29}
