public class AssociateAddressRequest extends AmazonWebServiceRequest implements Serializable, DryRunSupportedRequest<AssociateAddressRequest>
AssociateAddress operation
.
Associates an Elastic IP address with an instance or a network interface.
An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses in the Amazon Elastic Compute Cloud User Guide .
[EC2-Classic, default VPC] If the Elastic IP address is already associated with a different instance, it is disassociated from that instance and associated with the specified instance.
[EC2-VPC] If you don't specify a private IP address, the Elastic IP address is associated with the primary IP address. If the Elastic IP address is already associated with a different instance or a network interface, you get an error unless you allow reassociation.
This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.
NOOP
Constructor and Description |
---|
AssociateAddressRequest()
Default constructor for a new AssociateAddressRequest object.
|
AssociateAddressRequest(String instanceId,
String publicIp)
Constructs a new AssociateAddressRequest object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getAllocationId()
[EC2-VPC] The allocation ID.
|
Boolean |
getAllowReassociation()
[EC2-VPC] Allows an Elastic IP address that is already associated with
an instance or network interface to be re-associated with the
specified instance or network interface.
|
Request<AssociateAddressRequest> |
getDryRunRequest()
This method is intended for internal use only.
|
String |
getInstanceId()
The ID of the instance.
|
String |
getNetworkInterfaceId()
[EC2-VPC] The ID of the network interface.
|
String |
getPrivateIpAddress()
[EC2-VPC] The primary or secondary private IP address to associate
with the Elastic IP address.
|
String |
getPublicIp()
The Elastic IP address.
|
int |
hashCode() |
Boolean |
isAllowReassociation()
[EC2-VPC] Allows an Elastic IP address that is already associated with
an instance or network interface to be re-associated with the
specified instance or network interface.
|
void |
setAllocationId(String allocationId)
[EC2-VPC] The allocation ID.
|
void |
setAllowReassociation(Boolean allowReassociation)
[EC2-VPC] Allows an Elastic IP address that is already associated with
an instance or network interface to be re-associated with the
specified instance or network interface.
|
void |
setInstanceId(String instanceId)
The ID of the instance.
|
void |
setNetworkInterfaceId(String networkInterfaceId)
[EC2-VPC] The ID of the network interface.
|
void |
setPrivateIpAddress(String privateIpAddress)
[EC2-VPC] The primary or secondary private IP address to associate
with the Elastic IP address.
|
void |
setPublicIp(String publicIp)
The Elastic IP address.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
AssociateAddressRequest |
withAllocationId(String allocationId)
[EC2-VPC] The allocation ID.
|
AssociateAddressRequest |
withAllowReassociation(Boolean allowReassociation)
[EC2-VPC] Allows an Elastic IP address that is already associated with
an instance or network interface to be re-associated with the
specified instance or network interface.
|
AssociateAddressRequest |
withInstanceId(String instanceId)
The ID of the instance.
|
AssociateAddressRequest |
withNetworkInterfaceId(String networkInterfaceId)
[EC2-VPC] The ID of the network interface.
|
AssociateAddressRequest |
withPrivateIpAddress(String privateIpAddress)
[EC2-VPC] The primary or secondary private IP address to associate
with the Elastic IP address.
|
AssociateAddressRequest |
withPublicIp(String publicIp)
The Elastic IP address.
|
copyPrivateRequestParameters, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public AssociateAddressRequest()
public AssociateAddressRequest(String instanceId, String publicIp)
instanceId
- The ID of the instance. The operation fails if you
specify an instance ID unless exactly one network interface is
attached.publicIp
- The Elastic IP address.public String getInstanceId()
public void setInstanceId(String instanceId)
instanceId
- The ID of the instance. The operation fails if you specify an instance
ID unless exactly one network interface is attached.public AssociateAddressRequest withInstanceId(String instanceId)
Returns a reference to this object so that method calls can be chained together.
instanceId
- The ID of the instance. The operation fails if you specify an instance
ID unless exactly one network interface is attached.public String getPublicIp()
public void setPublicIp(String publicIp)
publicIp
- The Elastic IP address.public AssociateAddressRequest withPublicIp(String publicIp)
Returns a reference to this object so that method calls can be chained together.
publicIp
- The Elastic IP address.public String getAllocationId()
public void setAllocationId(String allocationId)
allocationId
- [EC2-VPC] The allocation ID. This is required for EC2-VPC.public AssociateAddressRequest withAllocationId(String allocationId)
Returns a reference to this object so that method calls can be chained together.
allocationId
- [EC2-VPC] The allocation ID. This is required for EC2-VPC.public String getNetworkInterfaceId()
public void setNetworkInterfaceId(String networkInterfaceId)
networkInterfaceId
- [EC2-VPC] The ID of the network interface. If the instance has more
than one network interface, you must specify a network interface ID.public AssociateAddressRequest withNetworkInterfaceId(String networkInterfaceId)
Returns a reference to this object so that method calls can be chained together.
networkInterfaceId
- [EC2-VPC] The ID of the network interface. If the instance has more
than one network interface, you must specify a network interface ID.public String getPrivateIpAddress()
public void setPrivateIpAddress(String privateIpAddress)
privateIpAddress
- [EC2-VPC] The primary or secondary private IP address to associate
with the Elastic IP address. If no private IP address is specified,
the Elastic IP address is associated with the primary private IP
address.public AssociateAddressRequest withPrivateIpAddress(String privateIpAddress)
Returns a reference to this object so that method calls can be chained together.
privateIpAddress
- [EC2-VPC] The primary or secondary private IP address to associate
with the Elastic IP address. If no private IP address is specified,
the Elastic IP address is associated with the primary private IP
address.public Boolean isAllowReassociation()
Default: false
Default: false
public void setAllowReassociation(Boolean allowReassociation)
Default: false
allowReassociation
- [EC2-VPC] Allows an Elastic IP address that is already associated with
an instance or network interface to be re-associated with the
specified instance or network interface. Otherwise, the operation
fails. Default: false
public AssociateAddressRequest withAllowReassociation(Boolean allowReassociation)
Default: false
Returns a reference to this object so that method calls can be chained together.
allowReassociation
- [EC2-VPC] Allows an Elastic IP address that is already associated with
an instance or network interface to be re-associated with the
specified instance or network interface. Otherwise, the operation
fails. Default: false
public Boolean getAllowReassociation()
Default: false
Default: false
public Request<AssociateAddressRequest> getDryRunRequest()
getDryRunRequest
in interface DryRunSupportedRequest<AssociateAddressRequest>
public String toString()
toString
in class Object
Object.toString()
Copyright © 2014. All rights reserved.