Associates an Anycast elastic IP address (Anycast EIP) with a cloud resource in a specified region.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes AssociateAnycastEipAddress

The operation that you want to perform. Set the value to AssociateAnycastEipAddress.

BindInstanceId String Yes lb-d7oxbixhxv1uupnon****

The ID of the cloud resource with which you want to associate the Anycast EIP.

BindInstanceRegionId String Yes us-west-1

The ID of the region where the cloud resource is deployed.

You can associate Anycast EIPs only with cloud resources in specific regions. You can call the DescribeAnycastServerRegions operation to query the region IDs.

BindInstanceType String Yes SlbInstance

The type of cloud resource with which you want to associate the Anycast EIP. Valid values:

  • SlbInstance: an internal-facing Server Load Balancer (SLB) instance that is deployed in a virtual private cloud (VPC)
  • NetworkInterface: an elastic network interface (ENI)
AnycastId String Yes aeip-bp1ix34fralt4ykf3****

The ID of the Anycast EIP.

ClientToken String No 123e4567-e89b-12d3-a456-426655440000

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

Note If you do not set this parameter, the system automatically uses RequestId as ClientToken. RequestId may be different for each API request.
DryRun Boolean No false

Specifies whether to only precheck the request. Valid values:

  • true: prechecks the request. After the request passes the precheck, the Anycast EIP is not associated with the instance. The system checks the required parameters, request syntax, and limits. If the request fails to pass the precheck, an error message is returned. If the request passes the precheck, the DryRunOperation error code is returned.
  • false (default): sends the API request. If the request passes the precheck, a 2xx HTTP status code is returned and the operation is performed.
PopLocations Array No

The information about the access points in associated access areas when you associate an Anycast EIP with a cloud resource.

If this is your first time to associate an Anycast EIP with a cloud resource, ignore this parameter. The system automatically associates all access areas.

You can call the DescribeAnycastPopLocations operation to query information about access points in supported access areas.

PopLocation String No us-west-1-pop

The information about the access points in associated access areas when you associate an Anycast EIP with a cloud resource.

If this is your first time to associate an Anycast EIP with a cloud resource, ignore this parameter. The system automatically associates all access areas.

You can call the DescribeAnycastPopLocations operation to query information about access points in supported access areas.

AssociationMode String No Default

The association mode. Valid values:

  • Default: the default mode. In this mode, cloud resources to be associated are set as default origin servers.
  • Normal: the standard mode. In this mode, cloud resources to be associated are set as standard origin servers.
Note

You can associate an Anycast EIP with cloud resources in multiple regions. However, you can set only one cloud resource as the default origin server. Other cloud resources are set as standard origin servers. If you do not specify or add an access point, requests are forwarded to the default origin server.

  • If this is your first time to associate an Anycast EIP with a cloud resource, set the value to Default.
  • If not, you can also set the value to Default, which specifies a new default origin server. In this case, the previous origin server functions as a standard origin server.
PrivateIpAddress String No 192.168.XX.XX

The secondary private IP address of the ENI with which you want to associate the Anycast EIP.

This parameter is valid only when you set BindInstanceType to NetworkInterface. If you do not set this parameter, the primary private IP address of the ENI is used.

Response parameters

Parameter Type Example Description
RequestId String FBDB18D8-E91E-4978-8D6C-6E2E3EE10133

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=AssociateAnycastEipAddress
&BindInstanceId=lb-d7oxbixhxv1uupnon****
&BindInstanceRegionId=us-west-1
&BindInstanceType=SlbInstance
&AnycastId=aeip-bp1ix34fralt4ykf3****
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&DryRun=false
&PopLocations=[{"PopLocation":"us-west-1-pop"}]
&AssociationMode=Default
&PrivateIpAddress=192.168.XX.XX
&Common request parameters

Sample success responses

XML format

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

<AssociateAnycastEipAddressResponse>
    <RequestId>FBDB18D8-E91E-4978-8D6C-6E2E3EE10133</RequestId>
</AssociateAnycastEipAddressResponse>

JSON format

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

{
  "RequestId" : "FBDB18D8-E91E-4978-8D6C-6E2E3EE10133"
}

Error codes

For a list of error codes, visit the API Error Center.