AssociateAddress
GET /?Action=AssociateAddress
Description
Associates an External IP address (EIP) with an instance or a network interface, in the public Cloud or in a Virtual Private Cloud (VPC). You can associate an EIP with only one instance or network interface at a time.
To associate an EIP in a VPC, ensure that the VPC has an Internet gateway attached. For more information, see the AttachInternetGateway method.
By default, the EIP is disassociated every time you stop and start the instance. For a persistent association, you can add the osc.fcu.eip.auto-attach
tag to the instance with the EIP as value. For more information, see the CreateTags method.
Note
|
You can associate an EIP with a NAT gateway only when creating the NAT gateway. To modify its EIP, you need to delete the NAT gateway and re-create it with the new EIP. For more information, see the CreateNatGateway method. |
Body parameter
Required: false
Name: AssociateAddressRequest
Name | Description | Required | Schema | Default | Example |
---|---|---|---|---|---|
AllocationId |
The allocation ID of the EIP. In a VPC, this parameter is required. |
false |
string |
||
AllowReassociation |
If set to |
false |
boolean |
||
InstanceId |
The ID of the instance. |
false |
string |
||
NetworkInterfaceId |
(VPC only) The ID of the network interface. |
false |
string |
||
PrivateIpAddress |
(VPC only) The primary or secondary private IP address of the specified network interface. By default, the primary private IP address. |
false |
string |
||
PublicIp |
The External IP address. In the public Cloud, this parameter is required. |
false |
string |
Responses
HTTP Code 200
HTTP Code | Description | Schema |
---|---|---|
200 |
AssociateAddressResult |
Response 200
Name | Description | Required | Schema | Default | Example |
---|---|---|---|---|---|
associationId |
(VPC only) The ID that represents the association of the EIP with the instance or the network interface. |
false |
string |
||
requestId |
The ID of the request. |
false |
string |