org.jclouds.ec2.services
Interface ElasticBlockStoreClient


public interface ElasticBlockStoreClient

Provides access to EC2 Elastic Block Store services.

Author:
Adrian Cole

Method Summary
 void addCreateVolumePermissionsToSnapshotInRegion(String region, Iterable<String> userIds, Iterable<String> userGroups, String snapshotId)
          Adds createVolumePermissions to an EBS snapshot.
 Attachment attachVolumeInRegion(String region, String volumeId, String instanceId, String device)
          Attaches an Amazon EBS volume to a running instance and exposes it as the specified device.
 Snapshot createSnapshotInRegion(String region, String volumeId, CreateSnapshotOptions... options)
          Creates a snapshot of an Amazon EBS volume and stores it in Amazon S3.
 Volume createVolumeFromSnapshotInAvailabilityZone(String availabilityZone, int size, String snapshotId)
          Creates a new Amazon EBS volume to which any Amazon EC2 instance can attach within the same Availability Zone.
 Volume createVolumeFromSnapshotInAvailabilityZone(String availabilityZone, String snapshotId)
          Creates a new Amazon EBS volume to which any Amazon EC2 instance can attach within the same Availability Zone.
 Volume createVolumeInAvailabilityZone(String availabilityZone, int size)
          Creates a new Amazon EBS volume to which any Amazon EC2 instance can attach within the same Availability Zone.
 void deleteSnapshotInRegion(String region, String snapshotId)
          Deletes a snapshot of an Amazon EBS volume that you own.
 void deleteVolumeInRegion(String region, String volumeId)
          Deletes an Amazon EBS volume that you own.
 Set<Snapshot> describeSnapshotsInRegion(String region, DescribeSnapshotsOptions... options)
          Returns information about Amazon EBS snapshots available to the user.
 Set<Volume> describeVolumesInRegion(String region, String... volumeIds)
          Describes the specified Amazon EBS volumes that you own.
 void detachVolumeInRegion(String region, String volumeId, boolean force, DetachVolumeOptions... options)
          Attaches an Amazon EBS volume to a running instance and exposes it as the specified device.
 Permission getCreateVolumePermissionForSnapshotInRegion(String region, String snapshotId)
          Returns the Permissions of an snapshot.
 void removeCreateVolumePermissionsFromSnapshotInRegion(String region, Iterable<String> userIds, Iterable<String> userGroups, String snapshotId)
          Removes createVolumePermissions from an EBS snapshot.
 void resetCreateVolumePermissionsOnSnapshotInRegion(String region, String snapshotId)
          Resets the createVolumePermissions on an EBS snapshot.
 

Method Detail

createVolumeFromSnapshotInAvailabilityZone

Volume createVolumeFromSnapshotInAvailabilityZone(String availabilityZone,
                                                  String snapshotId)
Creates a new Amazon EBS volume to which any Amazon EC2 instance can attach within the same Availability Zone. For more information about Amazon EBS, go to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.

Parameters:
availabilityZone - An Amazon EBS volume must be located within the same Availability Zone as the instance to which it attaches.
snapshotId - The snapshot from which to create the new volume.
See Also:
describeVolumesInRegion(java.lang.String, java.lang.String...), deleteVolumeInRegion(java.lang.String, java.lang.String), attachVolumeInRegion(java.lang.String, java.lang.String, java.lang.String, java.lang.String), detachVolumeInRegion(java.lang.String, java.lang.String, boolean, org.jclouds.ec2.options.DetachVolumeOptions...), AvailabilityZoneAndRegionClient.describeAvailabilityZonesInRegion(java.lang.String, org.jclouds.ec2.options.DescribeAvailabilityZonesOptions...),

createVolumeFromSnapshotInAvailabilityZone

Volume createVolumeFromSnapshotInAvailabilityZone(String availabilityZone,
                                                  int size,
                                                  String snapshotId)
Creates a new Amazon EBS volume to which any Amazon EC2 instance can attach within the same Availability Zone. This is overloaded createVolumeFromSnapshotInAvailabilityZone(java.lang.String, java.lang.String), which creates a volume with a specific size. For more information about Amazon EBS, go to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.

Parameters:
availabilityZone - An Amazon EBS volume must be located within the same Availability Zone as the instance to which it attaches.
size - Size of volume to be created
snapshotId - The snapshot from which to create the new volume.
See Also:
createVolumeFromSnapshotInAvailabilityZone(java.lang.String, java.lang.String), describeVolumesInRegion(java.lang.String, java.lang.String...), deleteVolumeInRegion(java.lang.String, java.lang.String), attachVolumeInRegion(java.lang.String, java.lang.String, java.lang.String, java.lang.String), detachVolumeInRegion(java.lang.String, java.lang.String, boolean, org.jclouds.ec2.options.DetachVolumeOptions...), AvailabilityZoneAndRegionClient.describeAvailabilityZonesInRegion(java.lang.String, org.jclouds.ec2.options.DescribeAvailabilityZonesOptions...),

createVolumeInAvailabilityZone

Volume createVolumeInAvailabilityZone(String availabilityZone,
                                      int size)
Creates a new Amazon EBS volume to which any Amazon EC2 instance can attach within the same Availability Zone. For more information about Amazon EBS, go to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.

Parameters:
availabilityZone - An Amazon EBS volume must be located within the same Availability Zone as the instance to which it attaches.
size - The size of the volume, in GiBs (1-1024). Required if you are not creating a volume from a snapshot.
See Also:
describeVolumesInRegion(java.lang.String, java.lang.String...), deleteVolumeInRegion(java.lang.String, java.lang.String), attachVolumeInRegion(java.lang.String, java.lang.String, java.lang.String, java.lang.String), detachVolumeInRegion(java.lang.String, java.lang.String, boolean, org.jclouds.ec2.options.DetachVolumeOptions...), AvailabilityZoneAndRegionClient.describeAvailabilityZonesInRegion(java.lang.String, org.jclouds.ec2.options.DescribeAvailabilityZonesOptions...),

describeVolumesInRegion

Set<Volume> describeVolumesInRegion(@Nullable
                                    String region,
                                    String... volumeIds)
Describes the specified Amazon EBS volumes that you own. If you do not specify one or more volume IDs, Amazon EBS describes all volumes that you own. For more information about Amazon EBS, go to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.

Parameters:
region - region where the volume is defined
volumeIds - The ID of the volume to list. Defaults to describe all volumes that you own.
See Also:
createSnapshotInRegion(java.lang.String, java.lang.String, org.jclouds.ec2.options.CreateSnapshotOptions...), #describeSnapshotInRegion,

deleteVolumeInRegion

void deleteVolumeInRegion(@Nullable
                          String region,
                          String volumeId)
Deletes an Amazon EBS volume that you own. For more information about Amazon EBS, go to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.

Parameters:
region - region where the volume is defined
volumeId - The ID of the volume to delete. The volume remains in the deleting state for several minutes after entering this command.
See Also:
describeVolumesInRegion(java.lang.String, java.lang.String...), #createVolumeInRegion, attachVolumeInRegion(java.lang.String, java.lang.String, java.lang.String, java.lang.String), detachVolumeInRegion(java.lang.String, java.lang.String, boolean, org.jclouds.ec2.options.DetachVolumeOptions...),

detachVolumeInRegion

void detachVolumeInRegion(@Nullable
                          String region,
                          String volumeId,
                          boolean force,
                          DetachVolumeOptions... options)
Attaches an Amazon EBS volume to a running instance and exposes it as the specified device.

Note

Windows instances currently support devices xvda through xvdp. Devices xvda and xvdb are reserved by the operating system, xvdc is assigned to drive C:\, and, depending on the instance type, devices xvdd through xvde might be reserved by the instance stores. Any device that is not reserved can be attached to an Amazon EBS volume. For a list of devices that are reserved by the instance stores, go to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.

Parameters:
region - region where the volume is defined
volumeId - The ID of the volume to delete. The volume remains in the deleting state for several minutes after entering this command.
force - Forces detachment if the previous detachment attempt did not occur cleanly (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 will not have an opportunity to flush file system caches nor file system meta data. If you use this option, you must perform file system check and repair procedures.
options - options like force()
See Also:
describeVolumesInRegion(java.lang.String, java.lang.String...), #createVolumeInRegion, attachVolumeInRegion(java.lang.String, java.lang.String, java.lang.String, java.lang.String), deleteVolumeInRegion(java.lang.String, java.lang.String),

attachVolumeInRegion

Attachment attachVolumeInRegion(@Nullable
                                String region,
                                String volumeId,
                                String instanceId,
                                String device)
Attaches an Amazon EBS volume to a running instance and exposes it as the specified device.

Note

Windows instances currently support devices xvda through xvdp. Devices xvda and xvdb are reserved by the operating system, xvdc is assigned to drive C:\, and, depending on the instance type, devices xvdd through xvde might be reserved by the instance stores. Any device that is not reserved can be attached to an Amazon EBS volume. For a list of devices that are reserved by the instance stores, go to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.

Parameters:
region - region where the volume is defined
volumeId - The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone and the instance must be running.
instanceId - The ID of the instance to which the volume attaches. The volume and instance must be within the same Availability Zone and the instance must be running.
device - Specifies how the device is exposed to the instance (e.g., /dev/sdh).
See Also:
describeVolumesInRegion(java.lang.String, java.lang.String...), #createVolumeInRegion, detachVolumeInRegion(java.lang.String, java.lang.String, boolean, org.jclouds.ec2.options.DetachVolumeOptions...), deleteVolumeInRegion(java.lang.String, java.lang.String),

createSnapshotInRegion

Snapshot createSnapshotInRegion(@Nullable
                                String region,
                                String volumeId,
                                CreateSnapshotOptions... options)
Creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. You can use snapshots for backups, to make identical copies of instance devices, and to save data before shutting down an instance. For more information about Amazon EBS, go to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.

When taking a snapshot of a file system, we recommend unmounting it first. This ensures the file system metadata is in a consistent state, that the 'mounted indicator' is cleared, and that all applications using that file system are stopped and in a consistent state. Some file systems, such as xfs, can freeze and unfreeze activity so a snapshot can be made without unmounting.

For Linux/UNIX, enter the following command from the command line.

 umount - d / dev / sdh
 

For Windows, open Disk Management, right-click the volume to unmount, and select Change Drive Letter and Path. Then, select the mount point to remove and click Remove.

Parameters:
region - Snapshots are tied to Regions and can only be used for volumes within the same Region.
volumeId - The ID of the Amazon EBS volume of which to take a snapshot.
options - options like passing a description.
Returns:
the Snapshot in progress
See Also:
describeSnapshotsInRegion(java.lang.String, org.jclouds.ec2.options.DescribeSnapshotsOptions...), deleteSnapshotInRegion(java.lang.String, java.lang.String),

describeSnapshotsInRegion

Set<Snapshot> describeSnapshotsInRegion(@Nullable
                                        String region,
                                        DescribeSnapshotsOptions... options)
Returns information about Amazon EBS snapshots available to the user. Information returned includes volume ID, status, start time, progress, owner ID, volume size, and description. Snapshots available to the user include public snapshots available for any user to createVolume, private snapshots owned by the user making the request, and private snapshots owned by other users for which the user granted explicit create volume permissions.

The create volume permissions fall into 3 categories:

Permission Description
public The owner of the snapshot granted create volume permissions for the snapshot to the all group. All users have create volume permissions for these snapshots.
explicit The owner of the snapshot granted create volume permissions to a specific user.
implicit A user has implicit create volume permissions for all snapshots he or she owns.

The list of snapshots returned can be modified by specifying snapshot IDs, snapshot owners, or users with create volume permissions. If no options are specified, Amazon EC2 returns all snapshots for which the user has create volume permissions.

If you specify one or more snapshot IDs, only snapshots that have the specified IDs are returned. If you specify an invalid snapshot ID, a fault is returned. If you specify a snapshot ID for which you do not have access, it will not be included in the returned results.

If you specify one or more snapshot owners, only snapshots from the specified owners and for which you have access are returned. The results can include the AWS Account IDs of the specified owners, amazon for snapshots owned by Amazon or self for snapshots that you own.

If you specify a list of restorable users, only users that have create snapshot permissions for the snapshots are returned. You can specify AWS Account IDs (if you own the snapshot(s)), self for snapshots for which you own or have explicit permissions, or all for public snapshots.

Parameters:
region - Snapshots are tied to Regions and can only be used for volumes within the same Region.
options - specify the snapshot ids or other parameters to clarify the list.
Returns:
matching snapshots.
See Also:
#createSnapshotsInRegion, deleteSnapshotInRegion(java.lang.String, java.lang.String),

deleteSnapshotInRegion

void deleteSnapshotInRegion(@Nullable
                            String region,
                            String snapshotId)
Deletes a snapshot of an Amazon EBS volume that you own. For more information, go to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.

Parameters:
region - Snapshots are tied to Regions and can only be used for volumes within the same Region.
snapshotId - The ID of the Amazon EBS snapshot to delete.
See Also:
createSnapshotInRegion(java.lang.String, java.lang.String, org.jclouds.ec2.options.CreateSnapshotOptions...), deleteSnapshotInRegion(java.lang.String, java.lang.String),

getCreateVolumePermissionForSnapshotInRegion

Permission getCreateVolumePermissionForSnapshotInRegion(@Nullable
                                                        String region,
                                                        String snapshotId)
Returns the Permissions of an snapshot.

Parameters:
region - AMIs are tied to the Region where its files are located within Amazon S3.
snapshotId - The ID of the AMI for which an attribute will be described
See Also:
#describeSnapshots, #modifySnapshotAttribute, #resetSnapshotAttribute, , DescribeSnapshotsOptions

addCreateVolumePermissionsToSnapshotInRegion

void addCreateVolumePermissionsToSnapshotInRegion(@Nullable
                                                  String region,
                                                  Iterable<String> userIds,
                                                  Iterable<String> userGroups,
                                                  String snapshotId)
Adds createVolumePermissions to an EBS snapshot.

Parameters:
region - Snapshots are tied to Regions and can only be used for volumes within the same Region.
userIds - AWS Access Key ID.
userGroups - Name of the groups. Currently supports \"all.\""
snapshotId - The ID of the Amazon EBS snapshot.
See Also:
#removeCreateVolumePermissionsFromSnapshot, #describeSnapshotAttribute, #resetSnapshotAttribute,

resetCreateVolumePermissionsOnSnapshotInRegion

void resetCreateVolumePermissionsOnSnapshotInRegion(@Nullable
                                                    String region,
                                                    String snapshotId)
Resets the createVolumePermissions on an EBS snapshot.

Parameters:
region - Snapshots are tied to Regions and can only be used for volumes within the same Region.
snapshotId - The ID of the Amazon EBS snapshot.
See Also:
#addCreateVolumePermissionsToSnapshot, #describeSnapshotAttribute, #removeProductCodesFromSnapshot,

removeCreateVolumePermissionsFromSnapshotInRegion

void removeCreateVolumePermissionsFromSnapshotInRegion(@Nullable
                                                       String region,
                                                       Iterable<String> userIds,
                                                       Iterable<String> userGroups,
                                                       String snapshotId)
Removes createVolumePermissions from an EBS snapshot.

Parameters:
region - Snapshots are tied to Regions and can only be used for volumes within the same Region.
userIds - AWS Access Key ID.
userGroups - Name of the groups. Currently supports \"all.\""
snapshotId - The ID of the Amazon EBS snapshot.
See Also:
#addCreateVolumePermissionsToSnapshot, #describeSnapshotAttribute, #resetSnapshotAttribute,


Copyright © 2009-2011 jclouds. All Rights Reserved.