You can call this operation to disassociate an Elastic IP address from a cloud resource.

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
Action String Yes UnassociateEipAddress

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

AllocationId String Yes eip-2zeerraiwb7uj6i0d****

The instance ID of the Elastic IP address.

Force Boolean No false

Specifies whether to forcibly disassociate an Elastic IP address from a NAT gateway that is associated with a DNAT or SNAT entry. Valid values:

  • false: Do not force the disassociation. This is the default value.
  • true: Force the disassociation.
RegionId String Yes cn-hangzhou

The ID of the region to which the Elastic IP address belongs.

InstanceId String No i-hp3akk9irtd69jad****

The instance ID of the cloud resource from which the Elastic IP address is to disassociate.

InstanceType String No EcsInstance

The type of the cloud resource instance. Valid values:

  • EcsInstance: an ECS instance in a VPC. This is the default value.
  • SlbInstance: an SLB instance in a VPC.
  • NetworkInterface: the secondary ENI with the network type of VPC.
  • Nat: a NAT gateway.
  • HaVip a High-Availability Virtual IP Address (HaVip).
PrivateIpAddress String No 192.168.xx.2

The internal IP address of the ECS instance or ENI instance.

ClientToken String No 02fb3da4-130e-11e9-8e44-001sdfg

The client token that is used to ensure the idempotence of the request. You can use the client to generate a token, but you must ensure that the token is unique among different requests. Only ASCII characters are allowed. It can contain a maximum of 64 ASCII characters.

Response parameters

Parameter Type Example Description
RequestId String 0ED8D006-F706-4D23-88ED-E11ED28DCAC0

The ID of the request.

Examples

Sample requests

http(s)://vpc.aliyuncs.com/? Action=UnassociateEipAddress
&AllocationId=eip-2zeerraiwb7uj6i0d****
&<Common request parameters>

Sample success responses

XML format

<UnassociateEipAddressResponse>
	  <RequestId>0ED8D006-F706-4D23-88ED-E11ED28DCAC0</RequestId>
</UnassociateEipAddressResponse>

JSON format

{ 
    "RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}

Error codes

HTTP status code Error code Error message Description
404 InvalidAllocationId.NotFound Specified allocation ID is not found The error message returned because the specified public IP address does not exist.
400 IncorrectEipStatus Current elastic IP status does not support this operation. The error message returned because this operation cannot be performed while the specified Elastic IP address is in the current state.
400 InvalidInstanceId.NotFound Specified instance does not exist. The error message returned because the specified instance does not exist.
400 IncorrectInstanceStatus The current status of instance does not support this operation. The error message returned because this operation cannot be performed while the instance is in the current state.
400 InvalidInstanceType.ValueNotSupported The specified value of InstanceType is not supported. The error message returned because the specified InstanceType value is invalid.
400 IncorrectHaVipStatus This operation is denied because status of the specified HaVip is neither Available nor InUse. The error message returned because this operation cannot be performed while the status of the specified HaVip is neither Available nor InUse.
400 OperationDenied Eip of default vpc not allow this operation The error message returned because this operation is not supported while the Elastic IP address that is associated with the cloud resource in the default VPC.
404 Forbidden.RegionNotFound Specified region is not found during access authentication. The error message returned because the specified region does not exist.
400 InvalidParameter The specified parameter is not valid. The error message returned because the specified value of the parameter is invalid.
400 Forbidden The eip instance owner error The error message returned because you are not authorized to perform this operation on the Elastic IP address.
400 InvalidBindingStatus The eip binding status invalid. The error message returned because the associating status of the Elastic IP address is invalid.

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