Chama a operação AssociateHaVip para associar um HaVip a uma instância ECS ou a uma interface de rede (NIC) em uma Virtual Private Cloud (VPC).
Descrição da operação
Ao chamar esta operação para associar um HaVip, observe os seguintes itens:
-
O HaVip entra em vigor imediatamente após ser associado, sem a necessidade de reiniciar a instância ECS. No entanto, você deve configurar o HaVip nas interfaces de rede elásticas (ENIs) da instância ECS.
-
O HaVip e a instância ECS a serem associados devem pertencer ao mesmo vSwitch.
-
Um HaVip pode ser associado a até 10 instâncias ECS ou a até 10 interfaces de rede (NICs) ao mesmo tempo. No entanto, um HaVip não pode ser associado a instâncias ECS e interfaces de rede (NICs) simultaneamente.
-
A instância ECS a ser associada deve estar no estado Running ou Stopped.
-
O HaVip deve estar no estado Available ou InUse.
-
A operação AssociateHaVip é assíncrona. Após o envio de uma solicitação, o sistema retorna um ID de solicitação, mas a associação do HaVip não foi concluída. A tarefa de associação ainda está em execução em segundo plano. Você pode chamar DescribeHaVips para consultar o status de associação do HaVip:\n - Se o HaVip estiver no estado Associating, o HaVip está sendo associado.\n - Se o HaVip estiver no estado InUse, o HaVip está associado.\n- A operação AssociateHaVip não oferece suporte à associação simultânea do mesmo HaVip.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
vpc:AssociateHaVip |
create |
*Instance
*HaVip
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| ClientToken |
string |
Não |
O token do cliente usado para garantir a idempotência da solicitação. Você pode usar o cliente para gerar o token, mas deve garantir que o token seja exclusivo entre diferentes solicitações. O valor de ClientToken pode conter apenas caracteres ASCII. Nota
Se você não especificar este parâmetro, o sistema usará automaticamente o RequestId da solicitação de API como o ClientToken. O RequestId de cada solicitação de API pode ser diferente. |
0c593ea1-3bea-11e9-b96b-88e9fe63**** |
| RegionId |
string |
Sim |
O ID da região do HaVip. Você pode chamar a operação DescribeRegions para consultar a lista de regiões mais recente. |
cn-shanghai |
| HaVipId |
string |
Sim |
O ID do HaVip a ser associado. |
havip-2zeo05qre24nhrqpy**** |
| InstanceId |
string |
Sim |
O ID da instância ECS a ser associada ao HaVip. |
i-faf344422ffsfad**** |
| InstanceType |
string |
Não |
O tipo da instância a ser associada ao HaVip. Valores válidos:
|
EcsInstance |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
|||
| RequestId |
string |
O ID da solicitação. |
C44F62BE-9CE7-4277-B117-69243F3988BF |
Exemplos
Resposta de sucesso
JSON formato
{
"RequestId": "C44F62BE-9CE7-4277-B117-69243F3988BF"
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | OperationUnsupported.BindOnFreeNetworkInterface | The network interface must be attached to an ECS instance. | The ENI must be associated with an ECS instance. |
| 400 | OperationUnsupported.BindMultipleType | You cannot bind HaVip to multiple instance types. | You cannot associate the ECS instance and the ENI at the same time. |
| 400 | OperationUnsupported.BindOnMultipleVswitch | The bound instance and HaVip must be on the same vSwitch. | The instance to be associated and the HAVIP must belong to the same vSwitch. |
| 400 | InvalidVip.Status | vip invalid status | |
| 400 | IncorrectHaVipStatus | HaVip can be operated by this action only when it's status is Available or InUse. | The operation supports only HAVIPs in the Available or InUse state. |
| 400 | IncorrectInstanceStatus | ECS instance can be operated by this action only when it?s status is Running or Stopped. | |
| 400 | CountLimitExceed.HaVipOnInstance | The amount of HaVip associated with the specified Instance reach its limits. | The number of HAVIPs has reached the upper limit. |
| 400 | CountLimitExceeded.HaVipOnECSInstance | The amount of Instance associated with the specified HaVip reach its limits. | The number of HAVIPs has reached the upper limit. |
| 400 | OperationFailed.DistibuteLock | Distibute lock fail. | The operation is locked by another request; |
| 400 | InvalidNetworkInterfaceId.NotFound | The network interface is not found. | The ENI does not exist. |
| 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 | OperationUnsupported.BindOnSameEcs | You cannot bind two network interfaces on the same ECS instance. | You are not allowed to associate two ENIs of the same ECS instance. |
| 400 | OperationUnsupported.HavipBindType | You cannot bind HAVIP to network interface in the specified region. | You are not allowed to associate ENIs in the specified region. |
| 400 | InvalidInstance.NotExist | InvalidInstance.NotExist : The specified Instance does not exist in the specified region. i-bp136w25mhx503ptilrh\r\nRequestId : A961CC27-D797-4E16-B1B3-19B9ECBA1495 | |
| 400 | OperationDenied.BindOnSameEcs | The operation is not allowed because networkinterface bind on same instance. | |
| 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. |
| 400 | InvalidInstanceId.NotFound | The specified Instance does not exist in the specified region. | |
| 400 | ResourceNotFound.EcsInstance | The specified resource of ECS instance is not found. | |
| 400 | InvalidStatus.NotAllow | Bind instance status invalid | The status of the associated instance is invalid. |
| 400 | InvalidHaVip.Exist | haVip already bind exist. | |
| 400 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | |
| 400 | QuotaExceeded.HaVipBindInstance | The amount of instance associated with the specified haVip reach its limits. | |
| 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. |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.