首页 弹性公网 IP 开发参考 API参考 API目录 弹性公网IP AssociateEipAddress - 将EIP绑定到云产品实例

AssociateEipAddress - 将EIP绑定到云产品实例

更新时间: 2023-10-11 00:02:55

将弹性公网IP(EIP)绑定到同地域的云产品实例上。

接口说明

  • EIP实例可绑定到同地域的专有网络类型的ECS实例、专有网络类型的CLB实例、辅助弹性网卡、NAT网关和高可用虚拟IP上。

  • AssociateEipAddress接口属于异步接口,即系统会先返回一个请求ID,但EIP实例与云产品实例并未绑定完成,系统后台的绑定任务仍在进行。您可以调用DescribeEipAddresses查询EIP实例的状态:

    • 当EIP实例处于Associating状态时,表示EIP实例正在绑定中,在该状态下,您只能执行查询操作,不能执行其他操作。
    • 当EIP实例处于InUse状态时,表示EIP实例绑定完成。
  • AssociateEipAddress接口不支持同一个EIP实例并发绑定云产品实例。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求参数

名称类型必填描述示例值
RegionIdstring

要绑定云产品实例的EIP所在的地域ID。

您可以通过调用DescribeRegions接口获取地域ID。

cn-hangzhou
AllocationIdstring

绑定云产品实例的EIP的ID。

eip-2zeerraiwb7ujsxdc****
InstanceIdstring

要绑定EIP的实例ID。

支持输入NAT网关实例ID、传统型负载均衡CLB实例ID、云服务器ECS实例ID、辅助弹性网卡实例ID、高可用虚拟IP实例ID、IP地址。

i-2zebb08phyczzawe****
InstanceTypestring

要绑定EIP的实例的类型,取值:

  • Nat:NAT网关。

  • SlbInstance:传统型负载均衡CLB。

  • EcsInstance(默认值):云服务器ECS。

  • NetworkInterface:辅助弹性网卡。

  • HaVip:高可用虚拟IP。

  • IpAddress:IP地址。

说明 默认要绑定EIP的实例类型为EcsInstance,如果您需要绑定EIP的实例类型不为EcsInstance,则该值必填。
EcsInstance
InstanceRegionIdstring

要绑定EIP的实例所属地域的ID。

说明 仅在EIP加入到带宽共享型全球加速实例后,才需要填写该参数。
cn-hangzhou
PrivateIpAddressstring

交换机网段内的一个IP地址。

如果不输入该参数,系统根据VPC ID和交换机ID自动分配一个私网IP地址。

192.168.XX.XX
Modestring

绑定模式,取值:

  • NAT(默认值):NAT模式(普通模式)。

  • MULTI_BINDED:多EIP网卡可见模式。

  • BINDED:EIP网卡可见模式。

说明 InstanceType配置为NetworkInterface时,才需要配置该参数。
NAT
VpcIdstring

开通了IPv4网关功能且与EIP同地域的VPC ID。

EIP绑定IP地址时,系统可以根据该VPC的路由配置,使绑定的IP地址具备公网访问能力。

说明 InstanceType取值为IpAddress时,即要绑定EIP的实例类型为IP地址时,该参数必填。
vpc-257gqcdfvx6n****
ClientTokenstring

客户端Token,用于保证请求的幂等性。

从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken只支持ASCII字符。

说明 若您未指定,则系统自动使用API请求的RequestId作为ClientToken标识。每次API请求的RequestId不一样。
0c593ea1-3bea-11e9-b96b-88e9fe63****

返回参数

名称类型描述示例值
object

返回信息列表。

RequestIdstring

请求ID。

0ED8D006-F706-4D23-88ED-E11ED28DCAC0

示例

正常返回示例

JSON格式

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

错误码

HTTP status code错误码错误信息描述
400InvalidAssociation.DuplicatedSpecified instance already is associated.该实例已绑定EIP或全球加速实例,不能再绑定,如需更换实例绑定的EIP或全球加速实例,请先解绑。
400OperationDeniedSpecified instance is not in VPC.该实例在VPC中不存在。
400InvalidParameter.MismatchSpecified elastic IP address and ECS instance are not in the same region.该EIP和ECS实例不在同一个地域内。
400IncorrectEipStatusCurrent elastic IP status does not support this operation当前EIP的状态不支持该操作。
400IncorrectInstanceStatusCurrent instance status does not support this operation.当前实例的状态不支持该操作。
400InvalidInstanceType.ValueNotSupportedThe specified value of InstanceType is not supported.参数InstanceType的值不合法。
400IncorrectHaVipStatusHaVip can be operated by this action only when it's status is Available or InUse.Havip实例为Available或InUse才允许操作
400InvalidParameterThe specified parameter is not valid.该参数值不合法。
400OperationDeniedEip of default vpc not allow this operation默认专有网络的EIP不支持该操作。
400TaskConflictThe eip operate too frequent, TaskConflict.操作过于频繁,任务冲突。
400InvalidBindingStatusThe eip binding status invalid.EIP绑定状态不正确。
400BIND_INSTANCE_HAVE_PORTMAP_OR_BIND_EIPThe instance may have portMap or already bind eip.ECS 实例已经存在端口转发规则,请删除相应的端口转发规则再进行操作。
400EIP_CAN_NOT_ASSOCIATE_WITH_PUBLIC_IPinstance already bind natpublicip,cannot bind eip.-
400BIND_INSTANCE_OWENER_ERRORCannot operate the eip.不能操作这个EIP。
400NATGATEWAY_FINANCIALLOCKEDThe NatGateway has expire, cannot do bind operation.-
400InvalidParameter.InstanceTypeNotSupportThe specified instance type is not support.-
400QuotaExceeded.NumberOfTrafficEipThe number of traffic eip on natgw exceed limitation.-
400QuotaExceeded.NumberOfEipBinded eip Quota exceed on this NatGw.此NAT网关上,绑定的EIP数量已经超出配额限制
400Forbidden.EipCanNotBindGatgwEip can not bind on natgw.-
400InvalidAction.DeniedAction is denied due to unfinished Eip configuration modification.由于未完成Eip配置修改,操作被拒绝。
400InstanceType.NotSupportThe instance type is invalid.-
400InvalidParams.NotFoundinstance not found实例不存在。
400BindInstance.NotSupportedbind instance type %s is not supported.-
400Forbidden.InstanceBandwidthNotZeroEip can not bind with instance when it's bandwidth is not zero.-
400INSTANCE_TYPE_NOT_SUPPORTThe instance type is invalid.-
400ServerRegion.InvalidEip bind remote server region invalid.-
400Eni.AttachedThe eni should be detached from ecs when associating with direct eip.当ENI绑定直通EIP时,需要ENI与ECS解绑
400Eni.HasSubIpEni has sub ip can not bind direct eip.-
400Invalid.DirectEip.BindTypeThe direct eip can be only associated with eni.-
400InvalidStatus.EcsStatusNotSupportThe special instance status is not support operate-
400Invalid.Function.NotSupportedMulti-IP function is under test, the region or uid is not supported.-
400InvalidStatus.EniStatusNotSupport%s-
400InvalidParameter.EniInstanceId%s-
400InvalidNexthop.DirectEniThe direct Eni cannot be nexthop.直通Eni不能作为下一跳
400Mode.ConflictThe eni can bind only one mode of eip.-
400Mode.NotSupportThe user cannot use multi direct eip.-
400QuotaExceed.MultiBindedEipThe number of multi binded eip is over limit.-
400InvalidEIPStatus.BizDisabledThe EIP has been locked.EIP实例被锁定
400OperationFailed.EniSubIpEni has sub ip can not bind direct eip.-
400InvalidEip.EipQuotaExceededThe specified eni assigned eip is more than privateIp.-
400OperationFailed.QueryCommodityInfoOperation failed because quey commodity info error.-
400OperationUnsupported.MultiIpMulti ip function is not support.-
400InvalidNicOrVm.NotFoundBind nic or vm not exist.-
400OperationUnsupported.EipBindModelThe instance type of ecs does not support MULTI_BINDED model Eip.-
400IncorrectStatus.NatGateway%s-
400EipBindRemote.BackendRegionMustBeSingleeip bind remote instance, backend region must be single-
400InvalidParameter.BindingInstanceRegionThe specified BindingInstanceRegion is not supported.-
400OperationFailed.HavipBoundPortmap%s-
400IllegalParam.Mode%s-
400InvalidStatus.NotAllowBind instance status invalid绑定实例状态无效
400InvalidInstance.NotExistBind instance data not exist-
400InvalidBandwidthPackageId.NotFoundThe specified BandwidthPackageId not exist.-
400ResourceQueryErrorThe specified resource is queried error.查询指定的资源时出错。
400InvalidStatus.InstanceHasBandWidthThe specified instance bandwidth invalid.-
400OperationDenied.CloudBoxResourceExistThe operation is not allowed because there are resources related to the cloud box in VPC.指定操作被禁止,因为VPC中存在云盒相关的资源。
400OperationDenied.CloudBoxVSwitchExistThe operation is not allowed because a cloud box type vSwitch exists in VPC.指定操作被禁止,因为VPC中存在云盒类型的虚拟交换机。
400OperationDenied.NoAvailablePrivateIpThe operation is failed because of vSwitch has not availalbe private ip当前虚拟交换机下的可用私网IP不足
400UnsupportedRegion%s-
400ResourceAlreadyAssociated.IpAddress%s-
400OperationFailed.Ipv4GatewayNotOpenedInVpcThe operation is failed because Ipv4Gateway is not opened in Vpc.EIP绑定IP失败,因为该VPC未开启IPv4网关.
400OperationFailed.Ipv4GatewayNotActivatedInVpcThe operation is failed because Ipv4Gateway is not activated in Vpc.-
400OperationDenied.L2EipBindIpAddress%s-
400ForbiddenThe eip instance owner errorEIP 不属于当前调用者,请您检查该 EIP 是否可被您调用。
400Forbidden.FinancialLockedThe ip business status is invalid.该实例已欠费锁定,无法操作
400UnsupportedFeature.EipBindIpAddressThe feature of EipBindIpAddress is not supported.Eip绑定IpAddress特性不支持。
400OperationFailed.InstanceNotExistThe ECS instance does not exist, or is not a VPC VM.ECS绑定EIP失败,因为ECS实例不存在或不是VPC虚拟机.
400OperationDenied.Ipv4GatewayExistThe operation is not allowed because of Ipv4GatewayExist.EIP绑定操作失败,因为此VPC下存在Ipv4网关
400OperationFailed.EipBindModeConflictEips can not bind Eni with NAT mode and MULTI_BINDED mode at the same time.Eip不能同时以NAT模式和多EIP网卡可见模式绑定ENI.
400OperationFailed.EcsMigratingThe operation is failed because of ECS is migrating.绑定操作失败,因为ECS正在迁移。
400OperationFailed.IpPrefixConflictThe operation failed due to the IP prefix of the ENI.当前操作与弹性网卡的IP Prefix冲突。
400UnsupportedFeature.EipBindPrefixIpThe feature of EipBindPrefixIp is not supported.当前地域不支持EIP绑定PrefixIp
400OperationDenied.UnsupportedEipBindModeThe operation is not supported for the NAT gateway due to its EIP binding mode.此NAT网关的EIP绑定类型不支持此操作。
400OperationDenied.UnauthorizedThe operation is not allowed because the user is not in the whitelist.此操作不被允许,用户不在白名单。
400OperationFailed.SystemBusyOperation failed because system is busy.系统繁忙,请稍后重试
404InvalidAllocationId.NotFoundSpecified allocation ID is not found.指定的公网 IP 不存在,请您检查填写的公网 IP 是否正确。
404InvalidInstanId.NotFoundSpecified instance does not exist.指定的实例不存在,请您检查该实例是否正确。
404InvalidRegionId.NotFoundSpecified value of InstanceRegionId is not supported.-
404InvalidAllocationId.NotFoundSpecified allocation ID is not found指定的公网IP不存在,请您检查您填写的参数是否正确。
404Forbidden.RegionNotFoundSpecified instance is not found during access authentication.当前Region不支持
404OperationDenied.VpcIpv4GatewayEnabledThe operation is not allowed because of the VPC of the NAT gateway has opened IPv4 Gateway.不允许操作,因为NAT网关的VPC已经开启IPv4网关
503ServiceUnavailableThe request has failed due to a temporary failure of the server.请求失败,因为临时服务器故障。

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2023-08-24OpenAPI 描述信息更新,OpenAPI 错误码发生变更看变更集
变更项变更内容
API 描述OpenAPI 描述信息更新
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:404
    删除错误码:503
2023-06-26OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:404
    删除错误码:503
2023-03-23OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:404
    删除错误码:503
阿里云首页 弹性公网 IP 相关技术圈