TGW
更新时间:2024-01-10
查询TGW列表
函数声明
def list_tgw(self, csn_id=None, marker=None, max_keys=None):
参数含义
请参考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_list_tgw.py
更新TGW信息
函数声明
def update_tgw(self, csn_id=None, tgw_id=None, update_tgw_request=None):
参数含义
请参考OpenAPI文档:https://cloud.baidu.com/doc/CSN/s/1l56h8zbr
返回值
操作成功:
{}
操作失败:
返回失败,错误列表参考:https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
代码示例
具体代码示例参考:example_update_tgw.py
查询TGW路由条目
函数声明
def list_tgw_rule(self, csn_id=None, tgw_id=None, list_tgw_rule_request=None, marker=None, max_keys=None):
参数含义
请参考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_list_tgw_rule.py