com.amazonaws.services.ec2.model
Class CreateSnapshotRequest

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

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

Container for the parameters to the CreateSnapshot operation.

Creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. You can use snapshots for backups, to make copies of Amazon EBS volumes, and to save data before shutting down an instance.

When a snapshot is created, any AWS Marketplace product codes that are associated with the source volume are propagated to the snapshot.

You can take a snapshot of an attached volume that is in use. However, snapshots only capture data that has been written to your Amazon EBS volume at the time the snapshot command is issued; this may exclude any data that has been cached by any applications or the operating system. If you can pause any file writes to the volume long enough to take a snapshot, your snapshot should be complete. However, if you cannot pause all file writes to the volume, you should unmount the volume from within the instance, issue the snapshot command, and then remount the volume to ensure a consistent and complete snapshot. You may remount and use your volume while the snapshot status is pending .

To create a snapshot for Amazon EBS volumes that serve as root devices, you should stop the instance before taking the snapshot.

Snapshots that are taken from encrypted volumes are automatically encrypted. Volumes that are created from encrypted snapshots are also automatically encrypted. Your encrypted volumes and any associated snapshots always remain protected.

For more information, see Amazon Elastic Block Store and Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .

See Also:
AmazonEC2.createSnapshot(CreateSnapshotRequest), Serialized Form

Constructor Summary
CreateSnapshotRequest()
          Default constructor for a new CreateSnapshotRequest object.
CreateSnapshotRequest(java.lang.String volumeId, java.lang.String description)
          Constructs a new CreateSnapshotRequest object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getDescription()
          A description for the snapshot.
 Request<CreateSnapshotRequest> getDryRunRequest()
          This method is intended for internal use only.
 java.lang.String getVolumeId()
          The ID of the Amazon EBS volume.
 int hashCode()
           
 void setDescription(java.lang.String description)
          A description for the snapshot.
 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.
 CreateSnapshotRequest withDescription(java.lang.String description)
          A description for the snapshot.
 CreateSnapshotRequest 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

CreateSnapshotRequest

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


CreateSnapshotRequest

public CreateSnapshotRequest(java.lang.String volumeId,
                             java.lang.String description)
Constructs a new CreateSnapshotRequest 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.
description - A description for the snapshot.
Method Detail

getVolumeId

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

Returns:
The ID of the Amazon EBS volume.

setVolumeId

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

Parameters:
volumeId - The ID of the Amazon EBS volume.

withVolumeId

public CreateSnapshotRequest withVolumeId(java.lang.String volumeId)
The ID of the Amazon EBS volume.

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

Parameters:
volumeId - The ID of the Amazon EBS volume.
Returns:
A reference to this updated object so that method calls can be chained together.

getDescription

public java.lang.String getDescription()
A description for the snapshot.

Returns:
A description for the snapshot.

setDescription

public void setDescription(java.lang.String description)
A description for the snapshot.

Parameters:
description - A description for the snapshot.

withDescription

public CreateSnapshotRequest withDescription(java.lang.String description)
A description for the snapshot.

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

Parameters:
description - A description for the snapshot.
Returns:
A reference to this updated object so that method calls can be chained together.

getDryRunRequest

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

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.