TGW
Query TGW list
Function declaration
1func (c *Client) ListTgw(csnId string, listTgwArgs *ListTgwArgs) (*ListTgwResponse, error)
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/8l16br10v
Response value
Operation succeeded:
1{
2 "nextMarker":"tgw-jkxx0kmm0t86vkfk",
3 "marker":"tgw-qhxx0kmm0t86vmpk",
4 "maxKeys":1,
5 "isTruncated":true,
6 "tgws":[
7 {
8 "tgwId":"tgw-vhw0idtdwbxi7n0p",
9 "csnId":"csn-3cq38gxc8irzuu0x",
10 "name":"tgw_1",
11 "description":"desc",
12 "region":"bj"
13 }
14 ]
15}
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_get_tgwlist.go
Update TGW information
Function declaration
1func (c *Client) UpdateTgw(csnId string, tgwId string, body *UpdateTgwRequest, clientToken string) error
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/1l56h8zbr
Response value
Operation succeeded:
1{}
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.go
Query routing entries of a TGW
Function declaration
1func (c *Client) ListTgwRule(csnId string, tgwId string, listTgwRuleArgs *ListTgwRuleArgs) (*ListTgwRuleResponse, error)
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/sl56rapu9
Response value
Operation succeeded:
1{
2 "nextMarker":"tgw-jkxx0kmm0t86vkfk",
3 "marker":"tgw-qhxx0kmm0t86vmpk",
4 "maxKeys":1,
5 "isTruncated":true,
6 "tgwRtRules":[
7 {
8 "ruleId":"cnrr-1db26d78-1781",
9 "routeType":"custom",
10 "csnId":"csn-m3dwj6tfysnmxmcy",
11 "csnRtId":"csnRt-w3x16fk8nr5kpxkx",
12 "fromAttachId":"tgwAttach-wg3z1z5baq3ry1a6",
13 "status":"conflicted",
14 "destAddress":"192.168.0.0/20",
15 "nextHopId":"vpc-fh43ygs8yp0d",
16 "nextHopName": "Default Virtual Private Cloud",
17 "nextHopRegion":"su",
18 "nextHopType":"vpc",
19 "asPath":"",
20 "community":"",
21 "blackHole":false
22 }
23 ]
24}
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.go
