You need to enable JavaScript to run this app.
导航

DeleteNatGateway

最近更新时间2024.04.18 19:18:17

首次发布时间2021.12.28 08:28:52

调用 DeleteNatGateway 接口,删除NAT网关实例。

接口说明

使用本接口删除NAT网关,必须同时满足如下条件:

  • NAT网关为按量计费,或包年包月NAT网关已到期。包年包月NAT网关到期前不支持删除,若需要提前释放,请参考 退订说明
  • NAT网关下没有SNAT规则。更多操作,请参考 DescribeSnatEntriesDeleteSnatEntry
  • NAT网关下没有DNAT规则。更多操作,请参考 DescribeDnatEntriesDeleteDnatEntry
  • NAT网关未绑定公网IP。更多操作,请参考 DescribeNatGatewayAttributesDisassociateEipAddress
  • NAT网关未被其他云服务托管。若被托管,请根据托管系统标签和对应云服务确认不再使用NAT网关后,解除托管。

    将NAT网关托管给云服务,云服务可以使用NAT网关的功能,并控制NAT网关的权限,即用户只能查看和修改托管NAT网关,不能删除NAT网关。
    NAT网关被云服务托管时,会被添加标签键(key)为volc:{ServiceCode}:ServiceManaged的托管系统标签,该标签键如volc:vke:ServiceManaged

调试

请求参数

参数名称
类型
是否必选
示例值
描述
ActionStringDeleteNatGateway要执行的操作,取值:DeleteNatGateway。
VersionString2020-04-01API的版本信息,当前版本为:2020-04-01。

NatGatewayId

String

ngw-vv3t043k05sm****

NAT网关的ID。
您可以调用 DescribeNatGateways 接口,查询NAT网关的ID。

返回数据

参数名称
类型
示例值
描述
RequestIdString2021062415303301022514515207C4****请求ID。

请求示例

GET /?Action=DeleteNatGateway&Version=2020-04-01&NatGatewayId=ngw-vv3t043k05sm**** HTTP/1.1
Host: open.volcengineapi.com
Service: natgateway
Region: cn-beijing

返回示例

{
    "ResponseMetadata": {
        "RequestId": "2021062415303301022514515207C4****",
        "Action": "DeleteNatGateway",
        "Version": "2020-04-01",
        "Service": "natgateway",
        "Region": "cn-beijing"
    },
    "Result":{
        "RequestId": "2021062415303301022514515207C4****"
    }
}

错误码

公共错误码,请参见 公共错误码 。

HttpCode
错误码
错误信息
描述
400InvalidNatGateway.InUseThe specified NAT gateway has dependent resource of EIP.指定的NAT网关已经绑定公网IP,无法删除。
400InvalidNatGateway.InvalidBillingTypeThe specified NAT gateway is not in the correct billing type for the request.指定的NAT网关所处计费类型无法响应该请求。
400InvalidNatGateway.InvalidStatusThe specified NAT gateway is not in the correct status for the request.指定的NAT网关所处的状态无法响应该请求。
403ForbiddenYou are not authorized to perform operations on the specified NAT gateway. The specified NAT gateway is a service-managed NAT gateway.无权限对指定NAT网关进行操作。指定的NAT网关为服务管控NAT网关。
404InvalidNatGateway.NotFoundThe specified NAT gateway does not exist.指定的NAT网关不存在。
409InvalidOperation.ConflictThe specified resource operation conflicts.指定的资源操作冲突。