You need to enable JavaScript to run this app.
导航
删除NAT网关
最近更新时间:2023.06.09 11:16:55首次发布时间:2023.06.09 11:16:55

本文介绍如何删除指定的NAT网关。

示例代码

# Example Code generated by Beijing Volcanoengine Technology.
from __future__ import print_function
import volcenginesdkcore
import volcenginesdknatgateway
from pprint import pprint
from volcenginesdkcore.rest import ApiException

if __name__ == '__main__':
    configuration = volcenginesdkcore.Configuration()

    # 设置您的ak
    configuration.ak = "AK"
    # 设置您的sk
    configuration.sk = "SK"
    # 设置您要访问的地域
    configuration.region = "cn-beijing"

    # 设置默认配置
    volcenginesdkcore.Configuration.set_default(configuration)

    # 使用全局默认配置
    api_instance = volcenginesdknatgateway.NATGATEWAYApi()

    # 删除NAT网关
    delete_nat_gateway_request = volcenginesdknatgateway.DeleteNatGatewayRequest(
        nat_gateway_id="ngw-vv3t043k05sm****", # NAT网关的ID
    )

	  # 发起请求并处理返回或异常
    try:
        resp = api_instance.delete_nat_gateway(delete_nat_gateway_request)
        pprint(resp)
    except ApiException as e:
        print("Exception when calling api: %s\n" % e)

相关文档