Disassociates a high-availability virtual IP address (HAVIP) from an elastic network interface (ENI) or an Elastic Compute Service (ECS) instance in a virtual private cloud (VPC).

Usage notes

When you call this operation, take note of the following limits:

  • The ECS instance must be in the Running or Stopped state.
  • The HAVIP must be in the Available or InUse state.
  • The UnassociateHaVip operation is asynchronous. After you send the request, the system returns a request ID. However, the operation is still being performed in the system background. You can call the DescribeHaVips operation to query the status of an HAVIP:
    • If the HAVIP is in the Unassociating state, the HAVIP is being disassociated.
    • If the HAVIP is in the Inuse or Available state, the HAVIP is disassociated.
  • You cannot repeatedly call the UnassociateHaVip operation to disassociate an HAVIP 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
Action String Yes UnassociateHaVip

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

ClientToken String No 0c593ea1-3bea-11e9-b96b-88e9fe63****

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 the value is unique among different requests. The ClientToken value can contain only ASCII characters and cannot exceed 64 characters in length.

RegionId String Yes cn-shanghai

The ID of the region to which the HAVIP belongs.

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

HaVipId String Yes havip-2zeo05qre24nhrqpy****

The ID of the HAVIP that you want to disassociate.

InstanceId String Yes i-faf344422ffsfad****

The ID of the ECS instance or ENI from which you want to disassociate the HAVIP.

Force String No True

Specifies whether to forcefully disassociate the HAVIP from the ECS instance or ENI. Valid values:

  • True: yes
  • False (default): no
Note If you set the value to False, you cannot disassociate the HAVIP from the primary instance.
InstanceType String No EcsInstance

The type of the instance from which you want to disassociate the HAVIP. Valid values:

  • EcsInstance: an ECS instance
  • NetworkInterface: an ENI
Note If you want to disassociate the HAVIP from an ENI, this parameter is required.

Response parameters

Parameter Type Example Description
RequestId String C44F62BE-9CE7-4277-B117-69243F3988BF

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UnassociateHaVip
&ClientToken=0c593ea1-3bea-11e9-b96b-88e9fe63****
&RegionId=cn-shanghai
&HaVipId=havip-2zeo05qre24nhrqpy****
&InstanceId=i-faf344422ffsfad****
&Force=True
&InstanceType=EcsInstance
&Common request parameters

Sample success responses

XML format

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

<UnassociateHaVipResponse>
    <RequestId>C44F62BE-9CE7-4277-B117-69243F3988BF</RequestId>
</UnassociateHaVipResponse>

JSON format

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

{
  "RequestId" : "C44F62BE-9CE7-4277-B117-69243F3988BF"
}

Error codes

HttpCode Error code Error message Description
400 IncorrectHaVipStatus HaVip can be operated by this action only when it's status is InUse. The error message returned because the operation can be performed only when the HAVIP is in the InUse state.
400 IncorrectInstanceStatus ECS instance can be operated by this action only when it's status is Running or Stopped. The error message returned because the operation can be performed only when the ECS instance is in the Running or Stopped state.
400 ResourceNotAssociated The HaVip and ECS instance are not associated. The error message returned because the HAVIP is not associated with an ECS instance.
400 Forbidden.UnassociateMaster Unassociating a master instance is not allowed unless the parameter Force is True. The error message returned because you cannot disassociate the HAVIP from a primary instance when the Force parameter is set to False.
400 OperationFailed.QueryNetworkInterfaceInfo Failed to query network interface information. The error message returned because the system failed to query ENI information.
400 IllegalParam.InstanceType The specified instance type is invalid. Only ECS instances and network interface are allowed. The error message returned because the type of the associated instance does not support this operation.
400 InvalidNetworkInterfaceId.NotFound The network interface is not found. The error message returned because the ENI does not exist.
400 ResourceNotFound.Instance The specified binding resource is not found. The error message returned because the associated resource does not exist.
404 InvalidHaVipId.NotFound The specified HaVip does not exist in the specified region. The error message returned because the specified HAVIP does not exist in the specified region. Check whether the region ID is correct.
404 InvalidInstanceId.NotFound The specified Instance does not exist in the specified region. The error message returned because the instance does not exist in the specified region.
500 InternalError The request processing has failed due to some unknown error. The error message returned because some unknown errors occurred.

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