For the complete documentation index, see llms.txt. This page is also available as Markdown.

AssociateEipAddress

1. API Description

This API (AssociateEipAddress) is used to associate elastic IPs to resources in the same region.

Note

  • You can call DescribeLoadBalancers to query supported load balancers.

  • You can call DescribeNetworkInterfaces to query supported vNIC.

  • You can call DescribeNatGateways to query supported NAT gateway.

  • You can call DescribeHaVips to query supported high availability virtual IPs.

  • You must specify exactly one of the following parameters: loadBalancerId, nicId, natId, or haVipId, in order of priority: loadBalancerId > nicId > natId > haVipId.

  • When associating via haVipId, bindType must be FullNat. Any other value will cause all elastic IPs in this request to fail to associate.

  • If the upper limit is exceeded, please contact us to request a quota increase.

  • The API returns the elastic IP IDs that failed to operate. An empty list indicates all operations succeeded.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

eipIds

Yes

Array of String

ID list of elastic IPs.

loadBalancerId

No

String

Load balancer ID.

nicId

No

String

vNIC ID.

lanIp

No

String

Private IP.

If nicId is provided, this field is required.

natId

No

String

NAT gateway ID.

haVipId

No

String

The ID of the high availability virtual IP.

bindType

No

Elastic IP mode.

Default value: FullNat .

Effective when the elastic IP is assigned to a vNIC.

When associated to a high availability virtual IP (haVip), only FullNat is supported. Any other value will cause all elastic IPs in this request to fail to associate.

Default value: FullNat

3. Output Parameters

Parameter Name
Type
Description

requestId

String

The unique request ID, which is returned for each request.

RequestId is required for locating a problem.

failedEipIds

Array of String

Elastic IP IDs that failed to bind.

4. Code Example

1. Associate elastic IPs to a specified vNIC with the Cut-through Mode.

2. Associate elastic IPs to a specified load balancer instance.

3. Associate elastic IPs to a specified NAT gateway.

4. Associate an elastic IP to a high availability virtual IP (HaVip).

5. Associate multiple elastic IPs to a high availability virtual IP (HaVip) at the same time.

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs,to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

HTTP Status Code
Error Code
Description

404

INVALID_LB_NOT_FOUND

Load balancer does not exist.

400

INVALID_LB_STATUS

State of load balancer is not supported.

400

INVALID_REGION_MISMATCH

Region mismatch.

404

INVALID_HAVIP_NOT_FOUND

The specified HaVip does not exist.

400

OPERATION_DENIED_EIP_ASSIGNED_LIMIT_EXCEEDED

Elastic IP binding exceeds the allowed limit.

Last updated