全部產品
Search
文件中心

NAT Gateway:DeleteNatIp

更新時間:Oct 26, 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暫無授權資訊透出。

請求參數

名稱

類型

必填

描述

樣本值

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. The Ipv4Prefix and NatIpCidr 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. NAT 閘道器存在依賴的 IPv6 SNAT 條目。在關閉 IPv6 之前,請先刪除這些條目。
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不存在。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情。