调用DeleteNatGateway接口删除指定的公网NAT网关。
接口说明
DeleteNatGateway 接口属于异步接口,即系统会先返回一个请求 ID,但该 NAT 网关实例并未删除完成,系统后台的删除任务仍在进行。您可以调用 DescribeNatGateways 查询 NAT 网关的状态:
-
当 NAT 网关处于 Deleting 状态时,表示 NAT 网关正在删除中,在该状态下,您只能执行查询操作,不能执行其他操作。
-
当查询不到该 NAT 网关实例时,表示 NAT 网关删除完成。
删除 NAT 网关操作不可恢复,请您谨慎操作。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
vpc:DeleteNatGateway |
delete |
*NatGateway
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
是 |
NAT 网关所在的地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。 |
cn-hangzhou |
| NatGatewayId |
string |
是 |
要删除的 NAT 网关的实例 ID。 |
ngw-bp1uewa15k4iy5770**** |
| Force |
boolean |
否 |
是否强制删除 NAT 网关,取值:
|
false |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
请求 ID。 |
||
| RequestId |
string |
请求 ID。 |
0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
示例
正常返回示例
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. | |
| 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. | |
| 404 | InvalidNatGatewayId.NotFound | The specified NatGatewayId does not exist in our records. | |
| 404 | ResourceNotFound.NatGateway | The specified resource of %s is not found. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。