com.amazonaws.services.ec2.model
Class AssociateAddressRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.ec2.model.AssociateAddressRequest
All Implemented Interfaces:
DryRunSupportedRequest<AssociateAddressRequest>, java.io.Serializable

public class AssociateAddressRequest
extends AmazonWebServiceRequest
implements java.io.Serializable, DryRunSupportedRequest<AssociateAddressRequest>

Container for the parameters to the 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.

See Also:
AmazonEC2.associateAddress(AssociateAddressRequest), Serialized Form

Constructor Summary
AssociateAddressRequest()
          Default constructor for a new AssociateAddressRequest object.
AssociateAddressRequest(java.lang.String instanceId, java.lang.String publicIp)
          Constructs a new AssociateAddressRequest object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAllocationId()
          [EC2-VPC] The allocation ID.
 java.lang.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.
 java.lang.String getInstanceId()
          The ID of the instance.
 java.lang.String getNetworkInterfaceId()
          [EC2-VPC] The ID of the network interface.
 java.lang.String getPrivateIpAddress()
          [EC2-VPC] The primary or secondary private IP address to associate with the Elastic IP address.
 java.lang.String getPublicIp()
          The Elastic IP address.
 int hashCode()
           
 java.lang.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(java.lang.String allocationId)
          [EC2-VPC] The allocation ID.
 void setAllowReassociation(java.lang.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(java.lang.String instanceId)
          The ID of the instance.
 void setNetworkInterfaceId(java.lang.String networkInterfaceId)
          [EC2-VPC] The ID of the network interface.
 void setPrivateIpAddress(java.lang.String privateIpAddress)
          [EC2-VPC] The primary or secondary private IP address to associate with the Elastic IP address.
 void setPublicIp(java.lang.String publicIp)
          The Elastic IP address.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 AssociateAddressRequest withAllocationId(java.lang.String allocationId)
          [EC2-VPC] The allocation ID.
 AssociateAddressRequest withAllowReassociation(java.lang.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(java.lang.String instanceId)
          The ID of the instance.
 AssociateAddressRequest withNetworkInterfaceId(java.lang.String networkInterfaceId)
          [EC2-VPC] The ID of the network interface.
 AssociateAddressRequest withPrivateIpAddress(java.lang.String privateIpAddress)
          [EC2-VPC] The primary or secondary private IP address to associate with the Elastic IP address.
 AssociateAddressRequest withPublicIp(java.lang.String publicIp)
          The Elastic IP address.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setDelegationToken, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollector
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssociateAddressRequest

public AssociateAddressRequest()
Default constructor for a new AssociateAddressRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.


AssociateAddressRequest

public AssociateAddressRequest(java.lang.String instanceId,
                               java.lang.String publicIp)
Constructs a new AssociateAddressRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
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.
Method Detail

getInstanceId

public java.lang.String getInstanceId()
The ID of the instance. The operation fails if you specify an instance ID unless exactly one network interface is attached.

Returns:
The ID of the instance. The operation fails if you specify an instance ID unless exactly one network interface is attached.

setInstanceId

public void setInstanceId(java.lang.String instanceId)
The ID of the instance. The operation fails if you specify an instance ID unless exactly one network interface is attached.

Parameters:
instanceId - The ID of the instance. The operation fails if you specify an instance ID unless exactly one network interface is attached.

withInstanceId

public AssociateAddressRequest withInstanceId(java.lang.String instanceId)
The ID of the instance. The operation fails if you specify an instance ID unless exactly one network interface is attached.

Returns a reference to this object so that method calls can be chained together.

Parameters:
instanceId - The ID of the instance. The operation fails if you specify an instance ID unless exactly one network interface is attached.
Returns:
A reference to this updated object so that method calls can be chained together.

getPublicIp

public java.lang.String getPublicIp()
The Elastic IP address.

Returns:
The Elastic IP address.

setPublicIp

public void setPublicIp(java.lang.String publicIp)
The Elastic IP address.

Parameters:
publicIp - The Elastic IP address.

withPublicIp

public AssociateAddressRequest withPublicIp(java.lang.String publicIp)
The Elastic IP address.

Returns a reference to this object so that method calls can be chained together.

Parameters:
publicIp - The Elastic IP address.
Returns:
A reference to this updated object so that method calls can be chained together.

getAllocationId

public java.lang.String getAllocationId()
[EC2-VPC] The allocation ID. This is required for EC2-VPC.

Returns:
[EC2-VPC] The allocation ID. This is required for EC2-VPC.

setAllocationId

public void setAllocationId(java.lang.String allocationId)
[EC2-VPC] The allocation ID. This is required for EC2-VPC.

Parameters:
allocationId - [EC2-VPC] The allocation ID. This is required for EC2-VPC.

withAllocationId

public AssociateAddressRequest withAllocationId(java.lang.String allocationId)
[EC2-VPC] The allocation ID. This is required for EC2-VPC.

Returns a reference to this object so that method calls can be chained together.

Parameters:
allocationId - [EC2-VPC] The allocation ID. This is required for EC2-VPC.
Returns:
A reference to this updated object so that method calls can be chained together.

getNetworkInterfaceId

public java.lang.String getNetworkInterfaceId()
[EC2-VPC] The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.

Returns:
[EC2-VPC] The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.

setNetworkInterfaceId

public void setNetworkInterfaceId(java.lang.String 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.

Parameters:
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.

withNetworkInterfaceId

public AssociateAddressRequest withNetworkInterfaceId(java.lang.String 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.

Returns a reference to this object so that method calls can be chained together.

Parameters:
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.
Returns:
A reference to this updated object so that method calls can be chained together.

getPrivateIpAddress

public java.lang.String getPrivateIpAddress()
[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.

Returns:
[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.

setPrivateIpAddress

public void setPrivateIpAddress(java.lang.String 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.

Parameters:
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.

withPrivateIpAddress

public AssociateAddressRequest withPrivateIpAddress(java.lang.String 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.

Returns a reference to this object so that method calls can be chained together.

Parameters:
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.
Returns:
A reference to this updated object so that method calls can be chained together.

isAllowReassociation

public java.lang.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. Otherwise, the operation fails.

Default: false

Returns:
[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


setAllowReassociation

public void setAllowReassociation(java.lang.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. Otherwise, the operation fails.

Default: false

Parameters:
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


withAllowReassociation

public AssociateAddressRequest withAllowReassociation(java.lang.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. Otherwise, the operation fails.

Default: false

Returns a reference to this object so that method calls can be chained together.

Parameters:
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

Returns:
A reference to this updated object so that method calls can be chained together.

getAllowReassociation

public java.lang.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. Otherwise, the operation fails.

Default: false

Returns:
[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


getDryRunRequest

public Request<AssociateAddressRequest> getDryRunRequest()
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.

Specified by:
getDryRunRequest in interface DryRunSupportedRequest<AssociateAddressRequest>

toString

public java.lang.String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.