public class AttachVolumeRequest extends AmazonWebServiceRequest implements java.io.Serializable, DryRunSupportedRequest<AttachVolumeRequest>
AttachVolume operation
.
Attaches an EBS volume to a running or stopped instance and exposes it to the instance with the specified device name.
Encrypted 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 EBS Volume to an Instance . Any device names that aren't reserved for instance store volumes can be used for 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:
The volume can be attached only to a stopped instance.
AWS Marketplace product codes are copied from the volume to the instance.
You must be subscribed to the product.
The instance type and operating system of the instance must support the product. For example, you can't detach a volume from a Windows instance and attach it to a Linux instance.
For an overview of the AWS Marketplace, see Introducing AWS Marketplace .
For more information about EBS volumes, see Attaching Amazon EBS Volumes in the Amazon Elastic Compute Cloud User Guide .
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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 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 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 EBS volume.
|
clone, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public AttachVolumeRequest()
public AttachVolumeRequest(java.lang.String volumeId, java.lang.String instanceId, java.lang.String device)
volumeId
- The ID of the 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 java.lang.String getVolumeId()
public void setVolumeId(java.lang.String volumeId)
volumeId
- The ID of the EBS volume. The volume and instance must be within the
same Availability Zone.public AttachVolumeRequest withVolumeId(java.lang.String volumeId)
Returns a reference to this object so that method calls can be chained together.
volumeId
- The ID of the EBS volume. The volume and instance must be within the
same Availability Zone.public java.lang.String getInstanceId()
public void setInstanceId(java.lang.String instanceId)
instanceId
- The ID of the instance.public AttachVolumeRequest withInstanceId(java.lang.String instanceId)
Returns a reference to this object so that method calls can be chained together.
instanceId
- The ID of the instance.public java.lang.String getDevice()
/dev/sdh
or xvdh
)./dev/sdh
or xvdh
).public void setDevice(java.lang.String device)
/dev/sdh
or xvdh
).device
- The device name to expose to the instance (for example,
/dev/sdh
or xvdh
).public AttachVolumeRequest withDevice(java.lang.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 java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.