TGW
更新时间:2025-01-02
查询TGW列表
函数声明
Go
1func (c *Client) ListTgw(csnId string, listTgwArgs *ListTgwArgs) (*ListTgwResponse, error)
参数含义
请参考OpenAPI文档:https://cloud.baidu.com/doc/CSN/s/8l16br10v
返回值
操作成功:
Go
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}
操作失败:
返回失败,错误列表参考:https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
代码示例
具体代码示例参考:example_get_tgwlist.go
更新TGW信息
函数声明
Go
1func (c *Client) UpdateTgw(csnId string, tgwId string, body *UpdateTgwRequest, clientToken string) error
参数含义
请参考OpenAPI文档:https://cloud.baidu.com/doc/CSN/s/1l56h8zbr
返回值
操作成功:
Go
1{}
操作失败:
返回失败,错误列表参考:https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
代码示例
具体代码示例参考:example_update_tgw.go
查询TGW路由条目
函数声明
Go
1func (c *Client) ListTgwRule(csnId string, tgwId string, listTgwRuleArgs *ListTgwRuleArgs) (*ListTgwRuleResponse, error)
参数含义
请参考OpenAPI文档:https://cloud.baidu.com/doc/CSN/s/sl56rapu9
返回值
操作成功:
Go
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":"默认私有网络",
17 "nextHopRegion":"su",
18 "nextHopType":"vpc",
19 "asPath":"",
20 "community":"",
21 "blackHole":false
22 }
23 ]
24}
操作失败:
返回失败,错误列表参考:https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
代码示例
具体代码示例参考:example_get_tgwrule.go