Class AssociateAddressRequest

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

public class AssociateAddressRequest extends AmazonWebServiceRequest implements Serializable, Cloneable, DryRunSupportedRequest<AssociateAddressRequest>

Contains the parameters for AssociateAddress.

See Also:
  • Constructor Details

    • AssociateAddressRequest

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

      public AssociateAddressRequest(String instanceId, 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. This is required for EC2-Classic. For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both. The operation fails if you specify an instance ID unless exactly one network interface is attached.
      publicIp - The Elastic IP address. This is required for EC2-Classic.
  • Method Details

    • setInstanceId

      public void setInstanceId(String instanceId)

      The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both. The operation fails if you specify an instance ID unless exactly one network interface is attached.

      Parameters:
      instanceId - The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both. The operation fails if you specify an instance ID unless exactly one network interface is attached.
    • getInstanceId

      public String getInstanceId()

      The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both. The operation fails if you specify an instance ID unless exactly one network interface is attached.

      Returns:
      The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both. The operation fails if you specify an instance ID unless exactly one network interface is attached.
    • withInstanceId

      public AssociateAddressRequest withInstanceId(String instanceId)

      The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both. The operation fails if you specify an instance ID unless exactly one network interface is attached.

      Parameters:
      instanceId - The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both. The operation fails if you specify an instance ID unless exactly one network interface is attached.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setPublicIp

      public void setPublicIp(String publicIp)

      The Elastic IP address. This is required for EC2-Classic.

      Parameters:
      publicIp - The Elastic IP address. This is required for EC2-Classic.
    • getPublicIp

      public String getPublicIp()

      The Elastic IP address. This is required for EC2-Classic.

      Returns:
      The Elastic IP address. This is required for EC2-Classic.
    • withPublicIp

      public AssociateAddressRequest withPublicIp(String publicIp)

      The Elastic IP address. This is required for EC2-Classic.

      Parameters:
      publicIp - The Elastic IP address. This is required for EC2-Classic.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setAllocationId

      public void setAllocationId(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.
    • getAllocationId

      public 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.
    • withAllocationId

      public AssociateAddressRequest withAllocationId(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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setNetworkInterfaceId

      public void setNetworkInterfaceId(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.
    • getNetworkInterfaceId

      public 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.
    • withNetworkInterfaceId

      public AssociateAddressRequest withNetworkInterfaceId(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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setPrivateIpAddress

      public void setPrivateIpAddress(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.
    • getPrivateIpAddress

      public 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.
    • withPrivateIpAddress

      public AssociateAddressRequest withPrivateIpAddress(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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setAllowReassociation

      public void setAllowReassociation(Boolean allowReassociation)

      [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic IP address that is already associated with an instance or network interface to be reassociated with the specified instance or network interface. Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, reassociation is automatic, therefore you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.

      Parameters:
      allowReassociation - [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic IP address that is already associated with an instance or network interface to be reassociated with the specified instance or network interface. Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, reassociation is automatic, therefore you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.
    • getAllowReassociation

      public Boolean getAllowReassociation()

      [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic IP address that is already associated with an instance or network interface to be reassociated with the specified instance or network interface. Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, reassociation is automatic, therefore you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.

      Returns:
      [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic IP address that is already associated with an instance or network interface to be reassociated with the specified instance or network interface. Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, reassociation is automatic, therefore you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.
    • withAllowReassociation

      public AssociateAddressRequest withAllowReassociation(Boolean allowReassociation)

      [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic IP address that is already associated with an instance or network interface to be reassociated with the specified instance or network interface. Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, reassociation is automatic, therefore you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.

      Parameters:
      allowReassociation - [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic IP address that is already associated with an instance or network interface to be reassociated with the specified instance or network interface. Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, reassociation is automatic, therefore you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • isAllowReassociation

      public Boolean isAllowReassociation()

      [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic IP address that is already associated with an instance or network interface to be reassociated with the specified instance or network interface. Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, reassociation is automatic, therefore you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.

      Returns:
      [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic IP address that is already associated with an instance or network interface to be reassociated with the specified instance or network interface. Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, reassociation is automatic, therefore you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.
    • 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 String toString()
      Returns a string representation of this object; useful for testing and debugging.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this object.
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public AssociateAddressRequest clone()
      Description copied from class: AmazonWebServiceRequest
      Creates a shallow clone of this request. Explicitly does not clone the deep structure of the request object.
      Overrides:
      clone in class AmazonWebServiceRequest
      See Also: