TGW
更新时间:2025-01-02
查询TGW列表
函数声明
func (c *Client) ListTgw(csnId string, listTgwArgs *ListTgwArgs) (*ListTgwResponse, error)
参数含义
请参考OpenAPI文档:https://cloud.baidu.com/doc/CSN/s/8l16br10v
返回值
操作成功:
{
"nextMarker":"tgw-jkxx0kmm0t86vkfk",
"marker":"tgw-qhxx0kmm0t86vmpk",
"maxKeys":1,
"isTruncated":true,
"tgws":[
{
"tgwId":"tgw-vhw0idtdwbxi7n0p",
"csnId":"csn-3cq38gxc8irzuu0x",
"name":"tgw_1",
"description":"desc",
"region":"bj"
}
]
}
操作失败:
返回失败,错误列表参考:https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
代码示例
具体代码示例参考:example_get_tgwlist.go
更新TGW信息
函数声明
func (c *Client) UpdateTgw(csnId string, tgwId string, body *UpdateTgwRequest, clientToken string) error
参数含义
请参考OpenAPI文档:https://cloud.baidu.com/doc/CSN/s/1l56h8zbr
返回值
操作成功:
{}
操作失败:
返回失败,错误列表参考:https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
代码示例
具体代码示例参考:example_update_tgw.go
查询TGW路由条目
函数声明
func (c *Client) ListTgwRule(csnId string, tgwId string, listTgwRuleArgs *ListTgwRuleArgs) (*ListTgwRuleResponse, error)
参数含义
请参考OpenAPI文档:https://cloud.baidu.com/doc/CSN/s/sl56rapu9
返回值
操作成功:
{
"nextMarker":"tgw-jkxx0kmm0t86vkfk",
"marker":"tgw-qhxx0kmm0t86vmpk",
"maxKeys":1,
"isTruncated":true,
"tgwRtRules":[
{
"ruleId":"cnrr-1db26d78-1781",
"routeType":"custom",
"csnId":"csn-m3dwj6tfysnmxmcy",
"csnRtId":"csnRt-w3x16fk8nr5kpxkx",
"fromAttachId":"tgwAttach-wg3z1z5baq3ry1a6",
"status":"conflicted",
"destAddress":"192.168.0.0/20",
"nextHopId":"vpc-fh43ygs8yp0d",
"nextHopName":"默认私有网络",
"nextHopRegion":"su",
"nextHopType":"vpc",
"asPath":"",
"community":"",
"blackHole":false
}
]
}
操作失败:
返回失败,错误列表参考:https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
代码示例
具体代码示例参考:example_get_tgwrule.go