public class DetachVolumeRequest extends AmazonWebServiceRequest implements java.io.Serializable, DryRunSupportedRequest<DetachVolumeRequest>
DetachVolume operation
.
Detaches an EBS volume from an instance. Make sure to unmount any file systems on the device within your operating system before detaching the volume. Failure to do so results in the volume being stuck in a busy state while detaching.
If an Amazon EBS volume is the root device of an instance, it can't be detached while the instance is running. To detach the root volume, stop the instance first.
When a volume with an AWS Marketplace product code is detached from an instance, the product code is no longer associated with the instance.
For more information, see Detaching an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide .
Constructor and Description |
---|
DetachVolumeRequest()
Default constructor for a new DetachVolumeRequest object.
|
DetachVolumeRequest(java.lang.String volumeId)
Constructs a new DetachVolumeRequest object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getDevice()
The device name.
|
Request<DetachVolumeRequest> |
getDryRunRequest()
This method is intended for internal use only.
|
java.lang.Boolean |
getForce()
Forces detachment if the previous detachment attempt did not occur
cleanly (for example, logging into an instance, unmounting the volume,
and detaching normally).
|
java.lang.String |
getInstanceId()
The ID of the instance.
|
java.lang.String |
getVolumeId()
The ID of the volume.
|
int |
hashCode() |
java.lang.Boolean |
isForce()
Forces detachment if the previous detachment attempt did not occur
cleanly (for example, logging into an instance, unmounting the volume,
and detaching normally).
|
void |
setDevice(java.lang.String device)
The device name.
|
void |
setForce(java.lang.Boolean force)
Forces detachment if the previous detachment attempt did not occur
cleanly (for example, logging into an instance, unmounting the volume,
and detaching normally).
|
void |
setInstanceId(java.lang.String instanceId)
The ID of the instance.
|
void |
setVolumeId(java.lang.String volumeId)
The ID of the volume.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
DetachVolumeRequest |
withDevice(java.lang.String device)
The device name.
|
DetachVolumeRequest |
withForce(java.lang.Boolean force)
Forces detachment if the previous detachment attempt did not occur
cleanly (for example, logging into an instance, unmounting the volume,
and detaching normally).
|
DetachVolumeRequest |
withInstanceId(java.lang.String instanceId)
The ID of the instance.
|
DetachVolumeRequest |
withVolumeId(java.lang.String volumeId)
The ID of the volume.
|
clone, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public DetachVolumeRequest()
public DetachVolumeRequest(java.lang.String volumeId)
volumeId
- The ID of the volume.public java.lang.String getVolumeId()
public void setVolumeId(java.lang.String volumeId)
volumeId
- The ID of the volume.public DetachVolumeRequest withVolumeId(java.lang.String volumeId)
Returns a reference to this object so that method calls can be chained together.
volumeId
- The ID of the volume.public java.lang.String getInstanceId()
public void setInstanceId(java.lang.String instanceId)
instanceId
- The ID of the instance.public DetachVolumeRequest 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()
public void setDevice(java.lang.String device)
device
- The device name.public DetachVolumeRequest withDevice(java.lang.String device)
Returns a reference to this object so that method calls can be chained together.
device
- The device name.public java.lang.Boolean isForce()
public void setForce(java.lang.Boolean force)
force
- Forces detachment if the previous detachment attempt did not occur
cleanly (for example, logging into an instance, unmounting the volume,
and detaching normally). This option can lead to data loss or a
corrupted file system. Use this option only as a last resort to detach
a volume from a failed instance. The instance won't have an
opportunity to flush file system caches or file system metadata. If
you use this option, you must perform file system check and repair
procedures.public DetachVolumeRequest withForce(java.lang.Boolean force)
Returns a reference to this object so that method calls can be chained together.
force
- Forces detachment if the previous detachment attempt did not occur
cleanly (for example, logging into an instance, unmounting the volume,
and detaching normally). This option can lead to data loss or a
corrupted file system. Use this option only as a last resort to detach
a volume from a failed instance. The instance won't have an
opportunity to flush file system caches or file system metadata. If
you use this option, you must perform file system check and repair
procedures.public java.lang.Boolean getForce()
public Request<DetachVolumeRequest> getDryRunRequest()
getDryRunRequest
in interface DryRunSupportedRequest<DetachVolumeRequest>
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.