Associa um elastic IP address (EIP) a uma instância de recurso em nuvem na mesma região.
Descrição da operação
-
Um EIP pode ser associado a uma instância ECS do tipo virtual private cloud (VPC), uma instância CLB do tipo VPC, uma interface de rede elástica secundária (ENI), um gateway NAT da Internet ou um endereço IP virtual de alta disponibilidade (HAVIP) na mesma região.
-
A operação AssociateEipAddress é assíncrona. Após o envio da solicitação, o sistema retorna um ID de solicitação, mas a associação entre o EIP e a instância de recurso em nuvem ainda não está concluída. A tarefa de associação continua sendo executada em segundo plano. Você pode invocar DescribeEipAddresses para consultar o status do EIP:
Se o EIP estiver no estado Associating, o EIP está sendo associado. Nesse estado, você só pode executar operações de consulta.
Se o EIP estiver no estado InUse, o EIP está associado.
-
A operação AssociateEipAddress não suporta solicitações simultâneas para associar o mesmo EIP a instâncias de recursos em nuvem.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
vpc:AssociateEipAddress |
update |
*Address.
NatGateway.
Instância.
Associação.
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| RegionId |
string |
Não |
O ID da região do EIP a ser associado a uma instância de recurso em nuvem. Você pode chamar a operação DescribeRegions para consultar o ID da região. |
cn-hangzhou |
| AllocationId |
string |
Sim |
O ID do EIP a ser associado a uma instância de recurso em nuvem. |
eip-2zeerraiwb7ujsxdc**** |
| InstanceId |
string |
Sim |
O ID da instância a ser associada ao EIP. Você pode inserir o ID da instância de um gateway NAT da Internet, uma instância Classic Load Balancer (CLB), uma instância ECS, uma interface de rede elástica secundária (ENI), um endereço IP virtual de alta disponibilidade (HAVIP) ou um endereço IP. |
i-2zebb08phyczzawe**** |
| InstanceType |
string |
Não |
O tipo da instância a ser associada ao EIP. Valores válidos:
Nota
O tipo de instância padrão é EcsInstance. Se o tipo de instância não for EcsInstance, este parâmetro é obrigatório. |
EcsInstance |
| InstanceRegionId |
string |
Não |
O ID da região da instância a ser associada ao EIP. Nota
Este parâmetro é obrigatório somente após o EIP ser adicionado a uma instância do Alibaba Cloud Global Accelerator (GA) com largura de banda compartilhada. |
cn-hangzhou |
| PrivateIpAddress |
string |
Não |
Um endereço IP no bloco CIDR do vSwitch. Se você não especificar este parâmetro, o sistema atribuirá automaticamente um endereço IP privado com base no ID da VPC e no ID do vSwitch. Nota
Se InstanceType estiver definido como NetworkInterface, este parâmetro é obrigatório. Insira o endereço IP privado a ser associado. |
192.168.XX.XX |
| Mode |
string |
Não |
O modo de associação. Valores válidos:
Nota
Este parâmetro é obrigatório somente quando InstanceType está definido como NetworkInterface. |
NAT |
| VpcId |
string |
Não |
O ID da VPC que tem o recurso de gateway IPv4 ativado e está na mesma região do EIP. Quando o EIP é associado a um endereço IP, o sistema usa a configuração de roteamento desta VPC para habilitar o acesso à rede pública para o endereço IP associado. Nota
Este parâmetro é obrigatório quando InstanceType está definido como IpAddress. |
vpc-257gqcdfvx6n**** |
| ClientToken |
string |
Não |
O token de 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 token 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 pode ser diferente para cada solicitação de API. |
0c593ea1-3bea-11e9-b96b-88e9fe63**** |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
Os parâmetros de resposta. |
||
| RequestId |
string |
O ID da solicitação. |
0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
Exemplos
Resposta de sucesso
JSON formato
{
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | InvalidAssociation.Duplicated | Specified instance already is associated. | |
| 400 | OperationDenied | Specified instance is not in VPC. | |
| 400 | InvalidParameter.Mismatch | Specified elastic IP address and ECS instance are not in the same region. | |
| 400 | IncorrectEipStatus | Current elastic IP status does not support this operation | |
| 400 | IncorrectInstanceStatus | Current instance status does not support this operation. | |
| 400 | InvalidInstanceType.ValueNotSupported | The specified value of InstanceType is not supported. | |
| 400 | IncorrectHaVipStatus | HaVip can be operated by this action only when it's status is Available or InUse. | Esta operação é permitida apenas quando a instância HaVip estiver no estado Available ou InUse. |
| 400 | InvalidParameter | The specified parameter is not valid. | |
| 400 | InvalidBindingStatus | The eip binding status invalid. | |
| 400 | BIND_INSTANCE_HAVE_PORTMAP_OR_BIND_EIP | The instance may have portMap or already bind eip. | A instância ECS já possui regras de encaminhamento de porta (DNAT). Exclua as regras de encaminhamento de porta correspondentes antes de continuar. |
| 400 | EIP_CAN_NOT_ASSOCIATE_WITH_PUBLIC_IP | instance already bind natpublicip,cannot bind eip. | |
| 400 | BIND_INSTANCE_OWENER_ERROR | Cannot operate the eip. | |
| 400 | NATGATEWAY_FINANCIALLOCKED | The NatGateway has expire, cannot do bind operation. | |
| 400 | InvalidParameter.InstanceTypeNotSupport | The specified instance type is not support. | |
| 400 | QuotaExceeded.NumberOfTrafficEip | The number of traffic eip on natgw exceed limitation. | |
| 400 | QuotaExceeded.NumberOfEip | Binded eip Quota exceed on this NatGw. | O número de EIPs associados a este gateway NAT excede o limite de cota. |
| 400 | Forbidden.EipCanNotBindGatgw | Eip can not bind on natgw. | |
| 400 | InvalidAction.Denied | Action is denied due to unfinished Eip configuration modification. | A operação foi rejeitada porque a modificação da configuração do EIP não foi concluída. |
| 400 | InstanceType.NotSupport | The instance type is invalid. | |
| 400 | InvalidParams.NotFound | instance not found | |
| 400 | BindInstance.NotSupported | bind instance type %s is not supported. | |
| 400 | Forbidden.InstanceBandwidthNotZero | Eip can not bind with instance when it's bandwidth is not zero. | |
| 400 | INSTANCE_TYPE_NOT_SUPPORT | The instance type is invalid. | |
| 400 | ServerRegion.Invalid | Eip bind remote server region invalid. | |
| 400 | Eni.Attached | The eni should be detached from ecs when associating with direct eip. | Quando uma ENI está associada a um EIP pass-through, a ENI deve ser desassociada da instância ECS. |
| 400 | Eni.HasSubIp | Eni has sub ip can not bind direct eip. | |
| 400 | Invalid.DirectEip.BindType | The direct eip can be only associated with eni. | |
| 400 | InvalidStatus.EcsStatusNotSupport | The special instance status is not support operate | |
| 400 | Invalid.Function.NotSupported | Multi-IP function is under test, the region or uid is not supported. | |
| 400 | InvalidStatus.EniStatusNotSupport | %s | |
| 400 | InvalidParameter.EniInstanceId | %s | |
| 400 | InvalidNexthop.DirectEni | The direct Eni cannot be nexthop. | Uma ENI pass-through não pode ser usada como próximo salto. |
| 400 | Mode.Conflict | The eni can bind only one mode of eip. | |
| 400 | Mode.NotSupport | The user cannot use multi direct eip. | |
| 400 | QuotaExceed.MultiBindedEip | The number of multi binded eip is over limit. | O número de EIPs que podem ser associados no modo multi-EIP-to-ENI excede o limite. |
| 400 | InvalidEIPStatus.BizDisabled | The EIP has been locked. | A instância do EIP está bloqueada. |
| 400 | OperationFailed.EniSubIp | Eni has sub ip can not bind direct eip. | |
| 400 | InvalidEip.EipQuotaExceeded | The specified eni assigned eip is more than privateIp. | |
| 400 | OperationUnsupported.MultiIp | Multi ip function is not support. | |
| 400 | InvalidNicOrVm.NotFound | Bind nic or vm not exist. | A ENI ou VM especificada para vinculação não existe. |
| 400 | OperationUnsupported.EipBindModel | The instance type of ecs does not support MULTI_BINDED model Eip. | |
| 400 | IncorrectStatus.NatGateway | %s | |
| 400 | EipBindRemote.BackendRegionMustBeSingle | eip bind remote instance, backend region must be single | |
| 400 | InvalidParameter.BindingInstanceRegion | The specified BindingInstanceRegion is not supported. | |
| 400 | OperationFailed.HavipBoundPortmap | %s | |
| 400 | IllegalParam.Mode | %s | |
| 400 | InvalidStatus.NotAllow | Bind instance status invalid | O status da instância anexada é inválido. |
| 400 | InvalidInstance.NotExist | Bind instance data not exist | |
| 400 | InvalidBandwidthPackageId.NotFound | The specified BandwidthPackageId not exist. | |
| 400 | InvalidStatus.InstanceHasBandWidth | The specified instance bandwidth invalid. | |
| 400 | OperationDenied.CloudBoxResourceExist | The operation is not allowed because there are resources related to the cloud box in VPC. | A operação é proibida porque a VPC contém recursos relacionados ao CloudBox. |
| 400 | OperationDenied.CloudBoxVSwitchExist | The operation is not allowed because a cloud box type vSwitch exists in VPC. | A operação é proibida porque a VPC contém vSwitches do tipo CloudBox. |
| 400 | OperationDenied.NoAvailablePrivateIp | The operation is failed because of vSwitch has not availalbe private ip | O número de endereços IP privados disponíveis no vSwitch atual é insuficiente. |
| 400 | ResourceAlreadyAssociated.IpAddress | %s | |
| 400 | OperationFailed.Ipv4GatewayNotOpenedInVpc | The operation is failed because Ipv4Gateway is not opened in Vpc. | Falha ao associar o EIP ao endereço IP porque o gateway IPv4 não está ativado para esta VPC. |
| 400 | OperationFailed.Ipv4GatewayNotActivatedInVpc | The operation is failed because Ipv4Gateway is not activated in Vpc. | |
| 400 | OperationDenied.L2EipBindIpAddress | %s | |
| 400 | Forbidden | The eip instance owner error | O EIP não pertence ao chamador atual. Verifique se você tem permissão para usar este EIP. |
| 400 | Forbidden.FinancialLocked | The ip business status is invalid. | Esta operação não pode ser realizada quando a interface do roteador possui um pagamento em atraso. |
| 400 | UnsupportedFeature.EipBindIpAddress | The feature of EipBindIpAddress is not supported. | A vinculação de um EIP a um endereço IP não é suportada. |
| 400 | OperationFailed.InstanceNotExist | The ECS instance does not exist, or is not a VPC VM. | Falha ao associar o EIP à instância ECS porque a instância ECS não existe ou não é uma instância de VPC. |
| 400 | OperationDenied.Ipv4GatewayExist | The operation is not allowed because of Ipv4GatewayExist. | |
| 400 | OperationFailed.EipBindModeConflict | Eips can not bind Eni with NAT mode and MULTI_BINDED mode at the same time. | |
| 400 | OperationFailed.EcsMigrating | The operation is failed because of ECS is migrating. | |
| 400 | OperationFailed.IpPrefixConflict | The operation failed due to the IP prefix of the ENI. | A operação atual entra em conflito com o prefixo de IP do controlador de interface de rede (NIC). |
| 400 | UnsupportedFeature.EipBindPrefixIp | The feature of EipBindPrefixIp is not supported. | A vinculação de um EIP a um PrefixIp não é suportada na região atual. |
| 400 | OperationDenied.UnsupportedEipBindMode | The operation is not supported for the NAT gateway due to its EIP binding mode. | O tipo de vinculação de EIP deste gateway NAT não suporta esta operação. |
| 400 | OperationDenied.Unauthorized | The operation is not allowed because the user is not in the whitelist. | A operação não é permitida porque o usuário não está na lista de permissões. |
| 400 | OperationFailed.SystemBusy | Operation failed because system is busy. | O sistema está ocupado. Tente novamente mais tarde. |
| 400 | OperationFailed.PrivateIpAddressNotExist | The operation failed because the PrivateIpAddress is not found. | O endereço IP privado especificado não existe. |
| 400 | IllegalParamFormat.%s | The param format of %s is illegal. | O modo do parâmetro é inválido. |
| 400 | MissingParam.InstanceId | The param of InstanceId can't be null or empty. | O parâmetro InstanceId não pode estar vazio. |
| 400 | InvalidEniType.SlaveEni | The eni type cannot be slave eni. | O tipo de ENI não pode ser uma ENI secundária. |
| 400 | IllegalParam.PrivateIpAddress | The specified PrivateIpAddress is illegal. | O PrivateIpAddress especificado é inválido. Verifique as restrições do parâmetro e tente novamente após fazer as correções. |
| 400 | OperationFailed.Ipv4GatewayNotAssociatedWithGatewayRouteTable | The operation failed because the specified IPv4 gateway of the VPC is not associated with any gateway route table. | O gateway IPv4 correspondente ao endereço IP associado ao EIP não está associado a nenhuma tabela de rotas de gateway. |
| 404 | InvalidAllocationId.NotFound | Specified allocation ID is not found. | |
| 404 | InvalidInstanId.NotFound | Specified instance does not exist. | |
| 404 | Forbidden.RegionNotFound | Specified instance is not found during access authentication. | A região atual não é suportada. |
| 404 | OperationDenied.VpcIpv4GatewayEnabled | The operation is not allowed because of the VPC of the NAT gateway has opened IPv4 Gateway. | A operação não é permitida porque a VPC do gateway NAT já possui um gateway IPv4 ativado. |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.