com.amazonaws.services.ec2.model
Class AttachVolumeRequest

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

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

Container for the parameters to the AttachVolume operation.

Attaches an Amazon EBS volume to a running or stopped instance and exposes it to the instance with the specified device name.

Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .

For a list of supported device names, see Attaching an Amazon EBS Volume to an Instance . Any device names that aren't reserved for instance store volumes can be used for Amazon EBS volumes. For more information, see Amazon EC2 Instance Store in the Amazon Elastic Compute Cloud User Guide .

If a volume has an AWS Marketplace product code:

For an overview of the AWS Marketplace, see https://aws.amazon.com/marketplace/help/200900000 . For more information about how to use the AWS Marketplace, see AWS Marketplace .

For more information about Amazon EBS volumes, see Attaching Amazon EBS Volumes in the Amazon Elastic Compute Cloud User Guide .

See Also:
AmazonEC2.attachVolume(AttachVolumeRequest), Serialized Form

Constructor Summary
AttachVolumeRequest()
          Default constructor for a new AttachVolumeRequest object.
AttachVolumeRequest(java.lang.String volumeId, java.lang.String instanceId, java.lang.String device)
          Constructs a new AttachVolumeRequest object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getDevice()
          The device name to expose to the instance (for example, /dev/sdh or xvdh).
 Request<AttachVolumeRequest> getDryRunRequest()
          This method is intended for internal use only.
 java.lang.String getInstanceId()
          The ID of the instance.
 java.lang.String getVolumeId()
          The ID of the Amazon EBS volume.
 int hashCode()
           
 void setDevice(java.lang.String device)
          The device name to expose to the instance (for example, /dev/sdh or xvdh).
 void setInstanceId(java.lang.String instanceId)
          The ID of the instance.
 void setVolumeId(java.lang.String volumeId)
          The ID of the Amazon EBS volume.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 AttachVolumeRequest withDevice(java.lang.String device)
          The device name to expose to the instance (for example, /dev/sdh or xvdh).
 AttachVolumeRequest withInstanceId(java.lang.String instanceId)
          The ID of the instance.
 AttachVolumeRequest withVolumeId(java.lang.String volumeId)
          The ID of the Amazon EBS volume.
 
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

AttachVolumeRequest

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


AttachVolumeRequest

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

Parameters:
volumeId - The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone.
instanceId - The ID of the instance.
device - The device name to expose to the instance (for example, /dev/sdh or xvdh).
Method Detail

getVolumeId

public java.lang.String getVolumeId()
The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone.

Returns:
The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone.

setVolumeId

public void setVolumeId(java.lang.String volumeId)
The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone.

Parameters:
volumeId - The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone.

withVolumeId

public AttachVolumeRequest withVolumeId(java.lang.String volumeId)
The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone.

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

Parameters:
volumeId - The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone.
Returns:
A reference to this updated object so that method calls can be chained together.

getInstanceId

public java.lang.String getInstanceId()
The ID of the instance.

Returns:
The ID of the instance.

setInstanceId

public void setInstanceId(java.lang.String instanceId)
The ID of the instance.

Parameters:
instanceId - The ID of the instance.

withInstanceId

public AttachVolumeRequest withInstanceId(java.lang.String instanceId)
The ID of the instance.

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

Parameters:
instanceId - The ID of the instance.
Returns:
A reference to this updated object so that method calls can be chained together.

getDevice

public java.lang.String getDevice()
The device name to expose to the instance (for example, /dev/sdh or xvdh).

Returns:
The device name to expose to the instance (for example, /dev/sdh or xvdh).

setDevice

public void setDevice(java.lang.String device)
The device name to expose to the instance (for example, /dev/sdh or xvdh).

Parameters:
device - The device name to expose to the instance (for example, /dev/sdh or xvdh).

withDevice

public AttachVolumeRequest withDevice(java.lang.String device)
The device name to expose to the instance (for example, /dev/sdh or xvdh).

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

Parameters:
device - The device name to expose to the instance (for example, /dev/sdh or xvdh).
Returns:
A reference to this updated object so that method calls can be chained together.

getDryRunRequest

public Request<AttachVolumeRequest> 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<AttachVolumeRequest>

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.