Deletes a NAT IP address.

Usage notes

  • DeleteNatIp is an asynchronous operation. After you make a request, the ID of the request is returned but the specified NAT IP address is not deleted. The system deletes the NAT IP address in the background. You can call the ListNatIps operation to query the status of a NAT IP address.
    • If a NAT IP address is in the Deleting state, the NAT IP address is being deleted. In this case, you can only query the NAT IP address but cannot perform other operations.
    • If the NAT IP address cannot be found, it is deleted.
  • You cannot repeatedly call the DeleteNatIp operation to delete a NAT IP address within the specified period of time.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
RegionId String Yes cn-qingdao

The region ID of the NAT gateway to which the NAT IP address that you want to delete belongs.

You can call the DescribeRegions operation to query the most recent region list.

NatIpId String Yes vpcnatip-gw8y7q3cpk3fggs87****

The ID of the NAT IP address that you want to delete.

DryRun Boolean No false

Specifies whether to check the request without performing the operation. Valid values:

  • true: checks the request without performing the operation. The system checks your AccessKey pair, the RAM user permissions, and the required parameters If the request fails to pass the check, the corresponding error message is returned. If the request passes the check, the DryRunOperation error code is returned.
  • false: sends the request. This is the default value. After the request passes the precheck, a 2XX HTTP status code is returned and the NAT IP address is deleted.
ClientToken String No 5A2CFF0E-5718-45B5-9D4D-70B3FF3898

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters.

Note If you do not set this parameter, ClientToken is set to the value of RequestId. RequestId of each API request may be different.
Action String Yes DeleteNatIp

The operation that you want to perform. Set the value to DeleteNatIp.

Response parameters

Parameter Type Example Description
RequestId String E9AD97A0-5338-43F8-8A80-5E274CCBA11B

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?RegionId=cn-qingdao
&NatIpId=vpcnatip-gw8y7q3cpk3fggs87****
&DryRun=false
&ClientToken=5A2CFF0E-5718-45B5-9D4D-70B3FF3898
&Action=DeleteNatIp
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DeleteNatIpResponse>
    <RequestId>E9AD97A0-5338-43F8-8A80-5E274CCBA11B</RequestId>
</DeleteNatIpResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

HttpCode Error code Error message Description
400 IncorrectStatus.NatIp The status of %s [%s] is incorrect. The error message returned because the status of the NAT IP address is invalid.
400 DependencyViolation.NatIp The specified resource of %s depends on %s, so the operation cannot be completed. The error message returned because the NAT gateway is associated with a NAT IP address and you cannot perform the operation.
400 IncorrectStatus.NatGateway %The status of %s [%s] is incorrect. The error message returned because the NAT gateway is in an invalid state.
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records. The error message returned because the specified region ID does not exist.
404 ResourceNotFound.NatIp The specified resource of %s is not found. The error message returned because the NAT IP address is not found.

For a list of error codes, visit the API Error Center.