全部产品
Search
文档中心

NAT 网关:DeleteNatIp - 删除NAT IP地址

更新时间:Jun 19, 2026

调用DeleteNatIp接口删除NAT IP地址。

接口说明

DeleteNatIp 接口属于异步接口,即系统会先返回一个请求 ID,但该 NAT IP 地址并未删除完成,系统后台的删除任务仍在进行。您可以调用 ListNatIps 查询 NAT IP 地址的删除状态:

  • 当 NAT IP 地址处于 Deleting 状态时,表示 NAT IP 地址正在删除中,在该状态下,您只能执行查询操作,不能执行其他操作。

  • 当查询不到该 NAT IP 地址时,表示 NAT IP 地址已删除。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

vpc:DeleteNatIp

delete

*NatGateway

acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId}

请求参数

名称

类型

必填

描述

示例值

RegionId

string

要删除的 NAT IP 地址所属 NAT 网关实例的地域 ID。

您可以通过调用 DescribeRegions 接口获取地域 ID。

cn-qingdao

NatIpId

string

要删除的 NAT IP 地址实例 ID。

vpcnatip-gw8y7q3cpk3fggs87****

NatGatewayId

string

要删除的 IP 前缀所属的 NAT 网关实例 ID。 当删除 IP 前缀时需要指定。

ngw-gw8v16wgvtq26vh59****

Ipv4Prefix

string

删除的 IP 前缀地址。

192.168.0.0/28

DryRun

boolean

是否只预检此次请求,取值:

  • true:发送检查请求,不会删除 NAT IP 地址。检查项包括 AccessKey 是否有效、RAM 用户的授权情况和是否填写了必需参数。如果检查不通过,则返回对应错误。如果检查通过,会返回错误码DryRunOperation

  • false(默认值):发送正常请求,通过检查后返回 2xx HTTP 状态码并删除 NAT IP 地址。

false

ClientToken

string

客户端 Token,用于保证请求的幂等性。

从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。

说明

若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 可能不一样。

5A2CFF0E-5718-45B5-9D4D-70B3FF3898

RegionId

string

要删除的 NAT IP 地址所属 NAT 网关实例的地域 ID。

您可以通过调用 DescribeRegions 接口获取地域 ID。

cn-qingdao

返回参数

名称

类型

描述

示例值

object

RequestId

string

请求 ID。

E9AD97A0-5338-43F8-8A80-5E274CCBA11B

示例

正常返回示例

JSON格式

{
  "RequestId": "E9AD97A0-5338-43F8-8A80-5E274CCBA11B"
}

错误码

HTTP status code

错误码

错误信息

描述

400 IncorrectStatus.NatIp The status of %s [%s] is incorrect. NatIp当前状态不正确。
400 OperationFailed.DefaultNatIp The operation is failed because of default NatIP can not be deleted. 操作失败,因为无法删除默认的NatIP。
400 DependencyViolation.NatIp The specified resource of %s depends on %s, so the operation cannot be completed. 有依赖的NAT IP,所以此操作不能进行
400 IncorrectStatus.NatGateway The status of %s [%s] is incorrect.
400 DependencyViolation.FullNatEntry The fullnat entry depends on this nat ip,so the operation cannot be completed. 存在Fullnat配置条目依赖此nat ip,因此本操作不能完成。
400 IllegalParam.NatIp The param of %s is illegal. 参数NatIp不合法。
400 Mismatch.Ipv4PrefixAndNatIpCidr The %s and %s are mismatched.
400 Mismatch.Ipv4PrefixAndCidrReservations The %s and %s are mismatched. Ipv4Prefix和交换机预留网段不匹配。
400 IllegalParam.Ipv4Prefix The param of %s is illegal. 参数Ipv4Prefix不合法。
400 DependencyViolation.%s The specified resource of [%s] depends on [%s], so the operation cannot be completed. 操作的资源[%s]依赖了[%s],请先删除依赖资源后再操作。
400 DependencyViolation.SnatEntry The specified resource of %s depends on %s, so the operation cannot be completed. NatIp或Ipv4Prefix存在关联的SnatEntry,删除操作无法继续,请删除依赖的Snat后再重新删除。
400 DependencyViolation.Ipv4Prefix The specified resource of %s depends on %s, so the operation cannot be completed. NatIp隶属于Ipv4Prefix不能单独删除,请直接删除Ipv4Prefix
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records.
404 ResourceNotFound.NatIp The specified resource of %s is not found.
404 ResourceNotFound.NatGateway The specified resource of %s is not found.
404 ResourceNotFound.NatIpCidr The specified resource of %s is not found.
404 ResourceNotFound.%s The specified resource of %s is not found. 指定的资源不存在
404 ResourceNotFound.Ipv4Prefix The specified resource of %s is not found. 资源Ipv4Prefix未找到,请检查该Ipv4Prefix是否存在。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情