org.jclouds.ec2.services
Interface AMIClient

All Known Subinterfaces:
AWSAMIClient

public interface AMIClient

Provides access to EC2 via their REST API.

Author:
Adrian Cole

Method Summary
 void addLaunchPermissionsToImageInRegion(String region, Iterable<String> userIds, Iterable<String> userGroups, String imageId)
          Adds launchPermissions to an AMI.
 String createImageInRegion(String region, String name, String instanceId, CreateImageOptions... options)
          Creates an AMI that uses an Amazon EBS root device from a "running" or "stopped" instance.
 void deregisterImageInRegion(String region, String imageId)
          Deregisters the specified AMI.
 Set<? extends Image> describeImagesInRegion(String region, DescribeImagesOptions... options)
          Returns information about AMIs, AKIs, and ARIs.
 Map<String,Image.EbsBlockDevice> getBlockDeviceMappingsForImageInRegion(String region, String imageId)
          Returns a map of device name to block device for the image.
 Permission getLaunchPermissionForImageInRegion(String region, String imageId)
          Returns the Permissions of an image.
 String registerImageFromManifestInRegion(String region, String name, String pathToManifest, RegisterImageOptions... options)
          Registers an AMI with Amazon EC2.
 String registerUnixImageBackedByEbsInRegion(String region, String name, String ebsSnapshotId, RegisterImageBackedByEbsOptions... options)
          Registers an AMI with Amazon EC2.
 void removeLaunchPermissionsFromImageInRegion(String region, Iterable<String> userIds, Iterable<String> userGroups, String imageId)
          Removes launchPermissions from an AMI.
 void resetLaunchPermissionsOnImageInRegion(String region, String imageId)
          Resets the launchPermissions on an AMI.
 

Method Detail

describeImagesInRegion

Set<? extends Image> describeImagesInRegion(@Nullable
                                            String region,
                                            DescribeImagesOptions... options)
Returns information about AMIs, AKIs, and ARIs. This includes image type, product codes, architecture, and kernel and RAM disk IDs. Images available to you include p ublic images, private images that you own, and private images owned by other users for which you have explicit launch permissions.

Parameters:
region - AMIs are tied to the Region where its files are located within Amazon S3.
See Also:
InstanceClient#describeInstances, #describeImageAttribute, , DescribeImagesOptions

getBlockDeviceMappingsForImageInRegion

Map<String,Image.EbsBlockDevice> getBlockDeviceMappingsForImageInRegion(@Nullable
                                                                        String region,
                                                                        String imageId)
Returns a map of device name to block device for the image.

Parameters:
region - AMIs are tied to the Region where its files are located within Amazon S3.
imageId - The ID of the AMI for which an attribute will be described
See Also:
#describeImages, #modifyImageAttribute, #resetImageAttribute, , DescribeImagesOptions

createImageInRegion

String createImageInRegion(@Nullable
                           String region,
                           String name,
                           String instanceId,
                           CreateImageOptions... options)
Creates an AMI that uses an Amazon EBS root device from a "running" or "stopped" instance.

Parameters:
region - AMIs are tied to the Region where its files are located within Amazon S3.
name - The name of the AMI that was provided during image creation. 3-128 alphanumeric characters, parenthesis (()), commas (,), slashes (/), dashes (-), or underscores(_)
instanceId - The ID of the instance.
Returns:
imageId
See Also:
, CreateImageOptions, InstanceClient#runInstances, InstanceClient#describeInstances, InstanceClient#terminateInstances,

deregisterImageInRegion

void deregisterImageInRegion(@Nullable
                             String region,
                             String imageId)
Deregisters the specified AMI. Once deregistered, the AMI cannot be used to launch new instances.

Parameters:
region - AMIs are tied to the Region where its files are located within Amazon S3.
imageId - Unique ID of the AMI which was assigned during registration. To register an AMI, use RegisterImage. To view the AMI IDs of AMIs that belong to your identity. use DescribeImages.
See Also:
#describeImages, #registerImage,

registerImageFromManifestInRegion

String registerImageFromManifestInRegion(@Nullable
                                         String region,
                                         String name,
                                         String pathToManifest,
                                         RegisterImageOptions... options)
Registers an AMI with Amazon EC2. Images must be registered before they can be launched. To launch instances, use the InstanceClient#runInstances operation.

Each AMI is associated with an unique ID which is provided by the Amazon EC2 service through this operation. If needed, you can deregister an AMI at any time.

Note

Any modifications to an AMI backed by Amazon S3 invalidates this registration. If you make changes to an image, deregister the previous image and register the new image.

Parameters:
region - AMIs are tied to the Region where its files are located within Amazon S3.
name - The name of the AMI that was provided during image creation. 3-128 alphanumeric characters, parenthesis (()), commas (,), slashes (/), dashes (-), or underscores(_)
pathToManifest - Full path to your AMI manifest in Amazon S3 storage.
options - Options to specify metadata such as architecture or secondary volumes to be associated with this image.
Returns:
imageId
See Also:
#describeImages, #deregisterImage,

registerUnixImageBackedByEbsInRegion

String registerUnixImageBackedByEbsInRegion(@Nullable
                                            String region,
                                            String name,
                                            String ebsSnapshotId,
                                            RegisterImageBackedByEbsOptions... options)
Registers an AMI with Amazon EC2. Images must be registered before they can be launched. To launch instances, use the InstanceClient#runInstances operation. The root device name is /dev/sda1

Each AMI is associated with an unique ID which is provided by the Amazon EC2 service through this operation. If needed, you can deregister an AMI at any time.

Note

AMIs backed by Amazon EBS are automatically registered when you create the image. However, you can use this to register a snapshot of an instance backed by Amazon EBS.

Amazon EBS snapshots are not guaranteed to be bootable.

Parameters:
region - AMIs are tied to the Region where its files are located within Amazon S3.
name - The name of the AMI that was provided during image creation. 3-128 alphanumeric characters, parenthesis (()), commas (,), slashes (/), dashes (-), or underscores(_)
ebsSnapshotId - The id of the root snapshot (e.g., snap-6eba6e06).
options - Options to specify metadata such as architecture or secondary volumes to be associated with this image.
Returns:
imageId
See Also:
#describeImages, #deregisterImage,

getLaunchPermissionForImageInRegion

Permission getLaunchPermissionForImageInRegion(@Nullable
                                               String region,
                                               String imageId)
Returns the Permissions of an image.

Parameters:
region - AMIs are tied to the Region where its files are located within Amazon S3.
imageId - The ID of the AMI for which an attribute will be described
See Also:
#describeImages, #modifyImageAttribute, #resetImageAttribute, , DescribeImagesOptions

addLaunchPermissionsToImageInRegion

void addLaunchPermissionsToImageInRegion(@Nullable
                                         String region,
                                         Iterable<String> userIds,
                                         Iterable<String> userGroups,
                                         String imageId)
Adds launchPermissions to an AMI.

Parameters:
region - AMIs are tied to the Region where its files are located within Amazon S3.
userIds - AWS Access Key ID.
userGroups - Name of the groups. Currently supports \"all.\""
imageId - The AMI ID.
See Also:
#removeLaunchPermissionsFromImage, #describeImageAttribute, #resetImageAttribute,

resetLaunchPermissionsOnImageInRegion

void resetLaunchPermissionsOnImageInRegion(@Nullable
                                           String region,
                                           String imageId)
Resets the launchPermissions on an AMI.

Parameters:
region - AMIs are tied to the Region where its files are located within Amazon S3.
imageId - ID of the AMI on which the attribute will be reset.
See Also:
#addLaunchPermissionsToImage, #describeImageAttribute, #removeProductCodesFromImage,

removeLaunchPermissionsFromImageInRegion

void removeLaunchPermissionsFromImageInRegion(@Nullable
                                              String region,
                                              Iterable<String> userIds,
                                              Iterable<String> userGroups,
                                              String imageId)
Removes launchPermissions from an AMI.

Parameters:
region - AMIs are tied to the Region where its files are located within Amazon S3.
userIds - AWS Access Key ID.
userGroups - Name of the groups. Currently supports \"all.\""
imageId - The AMI ID.
See Also:
#addLaunchPermissionsToImage, #describeImageAttribute, #resetImageAttribute,


Copyright © 2009-2012 jclouds. All Rights Reserved.