TGW
Query TGW list
Function declaration
1def list_tgw(self, csn_id=None, marker=None, max_keys=None):
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/8l16br10v
Response value
Operation succeeded:
1{
2 "metadata": {...}, # Common Description Information
3 "nextMarker":"tgw-jkxx0kmm0t86vkfk",
4 "marker":"tgw-qhxx0kmm0t86vmpk",
5 "maxKeys":1,
6 "isTruncated":true,
7 "tgws":[
8 {
9 "tgwId":"tgw-vhw0idtdwbxi7n0p",
10 "csnId":"csn-3cq38gxc8irzuu0x",
11 "name":"tgw_1",
12 "description":"desc",
13 "region":"bj"
14 }
15 ]
16}
Operation failed:
Return failure. For the error list, please refer to: https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
Code example
For specific code examples, please refer to: example_list_tgw.py
Update TGW information
Function declaration
1def update_tgw(self, csn_id=None, tgw_id=None, update_tgw_request=None):
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/1l56h8zbr
Response value
Operation succeeded:
1{
2 "metadata": {...} # Public description information
3}
Operation failed:
Return failure. For the error list, please refer to: https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
Code example
For specific code examples, please refer to: example_update_tgw.py
Query routing entries of a TGW
Function declaration
1def list_tgw_rule(self, csn_id=None, tgw_id=None, list_tgw_rule_request=None, marker=None, max_keys=None):
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/sl56rapu9
Response value
Operation succeeded:
1{
2 "metadata": {...}, # Common Description Information
3 "nextMarker":"tgw-jkxx0kmm0t86vkfk",
4 "marker":"tgw-qhxx0kmm0t86vmpk",
5 "maxKeys":1,
6 "isTruncated":true,
7 "tgwRtRules":[
8 {
9 "ruleId":"cnrr-1db26d78-1781",
10 "routeType":"custom",
11 "csnId":"csn-m3dwj6tfysnmxmcy",
12 "csnRtId":"csnRt-w3x16fk8nr5kpxkx",
13 "fromAttachId":"tgwAttach-wg3z1z5baq3ry1a6",
14 "status":"conflicted",
15 "destAddress":"192.168.0.0/20",
16 "nextHopId":"vpc-fh43ygs8yp0d",
17 "nextHopName": "Default Virtual Private Cloud",
18 "nextHopRegion":"su",
19 "nextHopType":"vpc",
20 "asPath":"",
21 "community":"",
22 "blackHole":false
23 }
24 ]
25}
Operation failed:
Return failure. For the error list, please refer to: https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
Code example
For specific code examples, refer to: example_list_tgw_rule.py
