com.amazonaws.services.ec2.model
Class DetachVolumeRequest

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

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

Container for the parameters to the DetachVolume operation.

Detaches an Amazon 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.

If the root volume is detached from an instance with an AWS Marketplace product code, then the AWS Marketplace product codes from that volume are no longer associated with the instance.

For more information, see Detaching an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide .

See Also:
AmazonEC2.detachVolume(DetachVolumeRequest), Serialized Form

Constructor Summary
DetachVolumeRequest()
          Default constructor for a new DetachVolumeRequest object.
DetachVolumeRequest(java.lang.String volumeId)
          Constructs a new DetachVolumeRequest object.
 
Method Summary
 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.
 
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

DetachVolumeRequest

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


DetachVolumeRequest

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

Parameters:
volumeId - The ID of the volume.
Method Detail

getVolumeId

public java.lang.String getVolumeId()
The ID of the volume.

Returns:
The ID of the volume.

setVolumeId

public void setVolumeId(java.lang.String volumeId)
The ID of the volume.

Parameters:
volumeId - The ID of the volume.

withVolumeId

public DetachVolumeRequest withVolumeId(java.lang.String volumeId)
The ID of the volume.

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

Parameters:
volumeId - The ID of the volume.
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 DetachVolumeRequest 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.

Returns:
The device name.

setDevice

public void setDevice(java.lang.String device)
The device name.

Parameters:
device - The device name.

withDevice

public DetachVolumeRequest withDevice(java.lang.String device)
The device name.

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

Parameters:
device - The device name.
Returns:
A reference to this updated object so that method calls can be chained together.

isForce

public 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). 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.

Returns:
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.

setForce

public 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). 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.

Parameters:
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.

withForce

public 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). 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.

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

Parameters:
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.
Returns:
A reference to this updated object so that method calls can be chained together.

getForce

public 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). 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.

Returns:
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.

getDryRunRequest

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

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.