调用AssociateEipAddressBatch接口批量将弹性公网IP(Elastic IP Address,简称EIP)绑定到同地域的云产品实例上。

使用说明

  • AssociateEipAddressBatch用于批量绑定EIP到云产品实例,仅支持批量绑定EIP到同地域的NAT网关实例或辅助弹性网卡实例。EIP绑定其他云产品实例,请参见AssociateEipAddress
  • AssociateEipAddressBatch接口属于异步接口,即系统会先返回一个请求ID,但EIP实例与云产品实例并未批量绑定完成,系统后台的绑定任务仍在进行。您可以调用DescribeEipAddresses查询EIP实例的状态:
    • 当EIP实例处于Associating状态时,表示EIP实例正在绑定中,在该状态下,您只能执行查询操作,不能执行其他操作。
    • 当EIP实例处于InUse状态时,表示EIP实例绑定完成。
  • AssociateEipAddressBatch接口不支持同一个EIP实例并发绑定云产品实例。

调试

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

请求参数

名称 类型 是否必选 示例值 描述
RegionId String cn-hangzhou

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

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

BindedInstanceId String ngw-hp3akk9irtd69jad****

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

支持输入NAT网关实例ID、辅助弹性网卡实例ID。

BindedInstanceType String Nat

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

  • Nat:NAT网关。
  • NetworkInterface:辅助弹性网卡。
Mode String MULTI_BINDED

绑定模式,仅取值为MULTI_BINDED,表示多EIP网卡可见模式。

InstanceType配置为NetworkInterface时,才需要配置该参数。

InstanceIds.N String eip-2zeerraiwb7ujsxdc****

需要与云产品实例绑定的EIP实例ID。

需至少输入1个EIP实例的ID,最多支持输入50个EIP实例的ID。

ClientToken String 02fb3da4-130e-11e9-8e44-0016e04115b

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

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

说明 若您未指定,则系统自动使用API请求的RequestId作为ClientToken标识。每次API请求的RequestId可能不一样。
Action String AssociateEipAddressBatch

系统规定参数。取值:AssociateEipAddressBatch

返回数据

名称 类型 示例值 描述
RequestId String 54B48E3D-DF70-471B-AA93-08E683A1B45

请求ID。

示例

请求示例

http(s)://[Endpoint]/?RegionId=cn-hangzhou
&BindedInstanceId=ngw-hp3akk9irtd69jad****
&BindedInstanceType=Nat
&Mode=MULTI_BINDED
&InstanceIds=["eip-2zeerraiwb7ujsxdc****\t"]
&ClientToken=02fb3da4-130e-11e9-8e44-0016e04115b
&Action=AssociateEipAddressBatch
&公共请求参数

正常返回示例

XML格式

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

<AssociateEipAddressBatchResponse>
    <RequestId>54B48E3D-DF70-471B-AA93-08E683A1B45</RequestId>
</AssociateEipAddressBatchResponse>

JSON格式

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

{
  "RequestId" : "54B48E3D-DF70-471B-AA93-08E683A1B45"
}

错误码

HttpCode 错误码 错误信息 描述
400 InvalidAssociation.Duplicated Specified instance already is associated. 该实例已绑定EIP或全球加速实例,不能再绑定,如需更换实例绑定的EIP或全球加速实例,请先解绑。
400 OperationDenied Specified instance is not in VPC. 该实例在VPC中不存在。
400 InvalidParameter.Mismatch Specified elastic IP address and ECS instance are not in the same region. 该EIP和ECS实例不在同一个地域内。
400 IncorrectEipStatus Current elastic IP status does not support this operation 当前EIP的状态不支持该操作。
400 IncorrectInstanceStatus Current instance status does not support this operation. 当前实例的状态不支持该操作。
400 InvalidInstanceType.ValueNotSupported The specified value of InstanceType is not supported. 参数InstanceType的值不合法。
400 InvalidParameter The specified parameter is not valid. 该参数值不合法。
400 OperationDenied Eip of default vpc not allow this operation 默认专有网络的EIP不支持该操作。
400 Forbbiden The eip instance owener error EIP 不属于当前调用者,请您检查该 EIP 是否可被您调用。
400 TaskConflict The eip operate too frequent, TaskConflict. 操作过于频繁,任务冲突。
400 InvalidBindingStatus The eip binding status invalid. EIP绑定状态不正确。
400 BIND_INSTANCE_HAVE_PORTMAP_OR_BIND_EIP The instance may have portMap or already bind eip. ECS 实例已经存在端口转发规则,请删除相应的端口转发规则再进行操作。
400 BIND_INSTANCE_OWENER_ERROR Cannot operate the eip. 不能操作这个EIP。
400 QuotaExceeded.NumberOfEip Binded eip Quota exceed on this NatGw. 此NAT网关上,绑定的EIP数量已经超出配额限制
400 InvalidAction.Denied Action is denied due to unfinished Eip configuration modification. 由于未完成Eip配置修改,操作被拒绝。
400 InvalidParams.NotFound instance not found 实例不存在。
400 Eni.Attached The eni should be detached from ecs when associating with direct eip. 当ENI绑定直通EIP时,需要ENI与ECS解绑
400 InvalidEIPStatus.BizDisabled The EIP has been locked. EIP实例被锁定
400 Forbidden.FinancialLocked The ip business status is invalid. 该实例已欠费锁定,无法操作
404 InvalidInstanId.NotFound Specified instance does not exist. 指定的实例不存在,请您检查该实例是否正确。
404 InvalidAllocationId.NotFound Specified allocation ID is not found 指定的公网IP不存在,请您检查您填写的参数是否正确。
404 Forbidden.RegionNotFound Specified instance is not found during access authentication. 当前Region不支持
404 OperationDenied.VpcIpv4GatewayEnabled The operation is not allowed because of the VPC of the NAT gateway has opened IPv4 Gateway. 不允许操作,因为NAT网关的VPC已经开启IPv4网关

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