Disassociates a high-availability virtual IP address (HAVIP) from an Elastic Compute Service (ECS) in a virtual private cloud (VPC) or from an elastic network interface (ENI).
Operation description
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.
-
UnassociateHaVip is an asynchronous operation. After a request is sent, the system returns a request ID and an instance ID and runs the task in the 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
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
vpc:UnassociateHaVip | delete |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ClientToken | string | No | The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The | 0c593ea1-3bea-11e9-b96b-88e9fe63**** |
RegionId | string | Yes | The region ID of the HAVIP. You can call the DescribeRegions operation to query the most recent region list. | cn-shanghai |
HaVipId | string | Yes | The ID of the HAVIP that you want to disassociate. | havip-2zeo05qre24nhrqpy**** |
InstanceId | string | Yes | The ID of the ECS instance or ENI from which you want to disassociate the HAVIP. | i-faf344422ffsfad**** |
Force | string | No | Specifies whether to forcefully disassociate the HAVIP from the ECS instance or ENI. Valid values:
Note
If you set the value to False, you cannot disassociate the HAVIP from the primary instance.
| True |
InstanceType | string | No | The type of the instance from which you want to disassociate the HAVIP. Valid values:
Note
If you want to disassociate the HAVIP from an ENI, this parameter is required.
| EcsInstance |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "C44F62BE-9CE7-4277-B117-69243F3988BF"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | IncorrectHaVipStatus | HaVip can be operated by this action only when it's status is InUse. | 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. | You can do this operation only when the ECS instance is running or stopped. |
400 | ResourceNotAssociated | The HaVip and ECS instance are not associated. | The HAVIP is not bound to the ECS instance. |
400 | Forbidden.UnassociateMaster | Unassociating a master instance is not allowed unless the parameter Force is True. | You cannot disassociate the HAVIP from a primary instance when Force is set to False. |
400 | IncorrectHaVipStatus | HaVip?s status is invalid. | - |
400 | HA.VIP.NOT.ASSOCIATED.WITH.INSTANCE | ha vip not associated with instance. | - |
400 | OperationFailed.DistibuteLock | Distibute lock fail. | The operation is locked by another request; |
400 | OperationFailed.QueryNetworkInterfaceInfo | Failed to query network interface information. | 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 type of the associated instance does not support this operation. |
400 | InvalidNetworkInterfaceId.NotFound | The network interface is not found. | The ENI does not exist. |
400 | ResourceNotFound.Instance | The specified binding resource is not found. | - |
400 | Forbidden.HaVip | No permissions to perform operations on HAVIPs. Please apply for privilege--vpc_privilege_allow_buy_havip_instance. | The error message returned because you do not have the permissions to manage the HAVIP. Go to the Quota Center page to acquire the permissions. |
404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | The RegionId parameter is set to an invalid value. Specify a valid value and try again. |
404 | InvalidHaVipId.NotFound | The specified HaVip does not exist in the specified region. | The specified HAVIP does not exist in the specified region. Check whether the specified region is correct. |
404 | InvalidInstanceId.NotFound | The specified Instance does not exist in the specified region. | The instance does not exist in the region. |
500 | InternalError | The request processing has failed due to some unknown error. | An unknown error occurred. |
For a list of error codes, visit the Service error codes.