public class AttachVolumeRequest extends AmazonWebServiceRequest implements Serializable, DryRunSupportedRequest<AttachVolumeRequest>
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 .
NOOP
Constructor and Description |
---|
AttachVolumeRequest()
Default constructor for a new AttachVolumeRequest object.
|
AttachVolumeRequest(String volumeId,
String instanceId,
String device)
Constructs a new AttachVolumeRequest object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
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.
|
String |
getInstanceId()
The ID of the instance.
|
String |
getVolumeId()
The ID of the Amazon EBS volume.
|
int |
hashCode() |
void |
setDevice(String device)
The device name to expose to the instance (for example,
/dev/sdh or xvdh ). |
void |
setInstanceId(String instanceId)
The ID of the instance.
|
void |
setVolumeId(String volumeId)
The ID of the Amazon EBS volume.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
AttachVolumeRequest |
withDevice(String device)
The device name to expose to the instance (for example,
/dev/sdh or xvdh ). |
AttachVolumeRequest |
withInstanceId(String instanceId)
The ID of the instance.
|
AttachVolumeRequest |
withVolumeId(String volumeId)
The ID of the Amazon EBS volume.
|
copyPrivateRequestParameters, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public AttachVolumeRequest()
public AttachVolumeRequest(String volumeId, String instanceId, String device)
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
).public String getVolumeId()
public void setVolumeId(String volumeId)
volumeId
- The ID of the Amazon EBS volume. The volume and instance must be
within the same Availability Zone.public AttachVolumeRequest withVolumeId(String volumeId)
Returns a reference to this object so that method calls can be chained together.
volumeId
- The ID of the Amazon EBS volume. The volume and instance must be
within the same Availability Zone.public String getInstanceId()
public void setInstanceId(String instanceId)
instanceId
- The ID of the instance.public AttachVolumeRequest withInstanceId(String instanceId)
Returns a reference to this object so that method calls can be chained together.
instanceId
- The ID of the instance.public String getDevice()
/dev/sdh
or xvdh
)./dev/sdh
or xvdh
).public void setDevice(String device)
/dev/sdh
or xvdh
).device
- The device name to expose to the instance (for example,
/dev/sdh
or xvdh
).public AttachVolumeRequest withDevice(String device)
/dev/sdh
or xvdh
).
Returns a reference to this object so that method calls can be chained together.
device
- The device name to expose to the instance (for example,
/dev/sdh
or xvdh
).public Request<AttachVolumeRequest> getDryRunRequest()
getDryRunRequest
in interface DryRunSupportedRequest<AttachVolumeRequest>
public String toString()
toString
in class Object
Object.toString()
Copyright © 2014. All rights reserved.