调用DeleteNatGateway接口删除指定的公网NAT网关。
接口说明
DeleteNatGateway 接口属于异步接口,即系统会先返回一个请求 ID,但该 NAT 网关实例并未删除完成,系统后台的删除任务仍在进行。您可以调用 DescribeNatGateways 查询 NAT 网关的状态:
- 
当 NAT 网关处于 Deleting 状态时,表示 NAT 网关正在删除中,在该状态下,您只能执行查询操作,不能执行其他操作。
 - 
当查询不到该 NAT 网关实例时,表示 NAT 网关删除完成。
 
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
 - 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
 - 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用前面加 * 表示。
 - 对于不支持资源级授权的操作,用
全部资源表示。 
 - 条件关键字:是指云产品自身定义的条件关键字。
 - 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
 
| 操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 | 
|---|---|---|---|---|
| vpc:DeleteNatGateway | delete | *NatGateway acs:vpc:{#regionId}:{#accountId}:natgateway/{#natgatewayid} | 
  | 无 | 
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 | 
|---|---|---|---|---|
| RegionId | string | 是 | NAT 网关所在的地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。  | cn-hangzhou | 
| NatGatewayId | string | 是 | 要删除的 NAT 网关的实例 ID。  | ngw-bp1uewa15k4iy5770**** | 
| Force | boolean | 否 | 是否强制删除 NAT 网关,取值: 
  | false | 
返回参数
示例
正常返回示例
JSON格式
{
  "RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}错误码
| HTTP status code | 错误码 | 错误信息 | 描述 | 
|---|---|---|---|
| 400 | DependencyViolation.VpcEndpointService | The specified resource of %s depends on %s, so the operation cannot be completed. | NAT有依赖的终端节点服务,所以此操作不能进行 | 
| 400 | DependencyViolation.FullNatEntry | The specified resource of %s depends on %s, so the operation cannot be completed. | - | 
| 400 | DependencyViolation.RouterEntry | The specified resource of %s depends on %s, so the operation cannot be completed. | NAT有依赖的路由条目,所以此操作不能进行 | 
| 400 | DependencyViolation.BandwidthPackages | There are BandwidthPackages on specified NatGateway not deleted. | NAT网关上有尚未删除的带宽包,请删除NAT网关下的所有带宽包后再重新操作。 | 
| 400 | DependencyViolation.EIPS | There are Eips on specified NatGateway, please unbind it first. | 指定的NAT网关已绑定了弹性公网IP,请先将其从NAT网关解绑。 | 
| 400 | Forbidden.PrePaidNatGateway | The specified NatGateway is PrePaid. | - | 
| 400 | InvalidOperation.DeletionProtection | The instance cannnot delete because of deletion protecion. | - | 
| 400 | DependencyViolation.SnatEntry | The specified resource of %s depends on %s, so the operation cannot be completed. | NatIp或Ipv4Prefix存在关联的SnatEntry,删除操作无法继续,请删除依赖的Snat后再重新删除。 | 
| 400 | IncorrectStatus.SnatEntry | The status of %s [%s] is incorrect. | - | 
| 400 | DependencyViolation.ForwardEntry | The specified resource of %s depends on %s, so the operation cannot be completed. | - | 
| 400 | IncorrectStatus.ForwardEntry | The status of %s [%s] is incorrect. | 要删除的DNAT条目实例状态不对 | 
| 400 | DependencyViolation.NatIp | The specified resource of %s depends on %s, so the operation cannot be completed. | 有依赖的NAT IP,所以此操作不能进行 | 
| 400 | IncorrectStatus.NatIp | The status of %s [%s] is incorrect. | NatIp当前状态不正确。 | 
| 400 | DependencyViolation.NatIpCidr | The specified resource of %s depends on %s, so the operation cannot be completed. | NAT有依赖的NAT IP CIDR,所以此操作不能进行 | 
| 400 | IncorrectStatus.NatGateway | The NatGateway instance is being deleted and needs to wait until the process is complete. | NAT网关实例正在被删除,无法重复删除,需要等待删除过程完成。 | 
| 400 | IncorrectStatus.RouterEntry | The status of %s [%s] is incorrect. | RouterEntry当前状态不正确。 | 
| 400 | IncorrectStatus.VSwitch | The specified vSwitch status is invalid. | 虚拟交换机状态异常。 | 
| 404 | INSTANCE_NOT_EXISTS | Instance not exists. | - | 
| 404 | InvalidRegionId.NotFound | The specified RegionId does not exist in our records. | 指定的RegionId不存在。 | 
| 404 | InvalidNatGatewayId.NotFound | The specified NatGatewayId does not exist in our records. | 指定的 NatGatewayId 不存在,请您检查填写的 NatGatewayId 是否正确。 | 
| 404 | IncorrectStatus.NatGateway | %s | - | 
| 404 | ResourceNotFound.NatGateway | The specified resource of %s is not found. | - | 
访问错误中心查看更多错误码。
变更历史
| 变更时间 | 变更内容概要 | 操作 | 
|---|---|---|
| 2024-01-18 | OpenAPI 错误码发生变更 | 查看变更详情 | 
| 2023-12-20 | OpenAPI 错误码发生变更 | 查看变更详情 | 
| 2023-07-24 | OpenAPI 描述信息更新、OpenAPI 错误码发生变更 | 查看变更详情 | 
