org.dasein.cloud.cloudstack.compute
Class Templates

java.lang.Object
  extended by org.dasein.cloud.cloudstack.compute.Templates
All Implemented Interfaces:
AccessControlledService, MachineImageSupport

public class Templates
extends Object
implements MachineImageSupport


Field Summary
 
Fields inherited from interface org.dasein.cloud.compute.MachineImageSupport
ANY, DOWNLOAD_IMAGE, GET_IMAGE, IMAGE_VM, LIST_IMAGE, MAKE_PUBLIC, REGISTER_IMAGE, REMOVE_IMAGE, SHARE_IMAGE, UPLOAD_IMAGE
 
Constructor Summary
Templates(CSCloud provider)
           
 
Method Summary
 void addImageShare(String providerImageId, String accountNumber)
           
 void addPublicShare(String providerImageId)
           
 String bundleVirtualMachine(String virtualMachineId, MachineImageFormat format, String bucket, String name)
           
 void bundleVirtualMachineAsync(String virtualMachineId, MachineImageFormat format, String bucket, String name, AsynchronousTask<String> trackingTask)
           
 MachineImage captureImage(ImageCreateOptions options)
           
 void captureImageAsync(ImageCreateOptions options, AsynchronousTask<MachineImage> taskTracker)
           
 MachineImage getImage(String providerImageId)
           
 MachineImage getMachineImage(String templateId)
          Deprecated. 
 String getProviderTermForImage(Locale locale)
          Deprecated. 
 String getProviderTermForImage(Locale locale, ImageClass cls)
           
 boolean hasPublicLibrary()
           
 Requirement identifyLocalBundlingRequirement()
           
 AsynchronousTask<String> imageVirtualMachine(String vmId, String name, String description)
          Deprecated. 
 boolean isImageSharedWithPublic(String templateId)
           
 boolean isSubscribed()
           
 Iterable<MachineImage> listImages(ImageClass cls)
           
 Iterable<MachineImage> listImages(ImageClass cls, String ownedBy)
           
 Iterable<ResourceStatus> listImageStatus(ImageClass cls)
           
 Iterable<MachineImage> listMachineImages()
          Deprecated. 
 Iterable<MachineImage> listMachineImagesOwnedBy(String accountId)
          Deprecated. 
 Iterable<String> listShares(String templateId)
           
 Iterable<MachineImageFormat> listSupportedFormats()
           
 Iterable<MachineImageFormat> listSupportedFormatsForBundling()
           
 Iterable<ImageClass> listSupportedImageClasses()
           
 Iterable<MachineImageType> listSupportedImageTypes()
           
 String[] mapServiceAction(ServiceAction action)
           
 MachineImage registerImageBundle(ImageCreateOptions options)
           
 void remove(String templateId)
           
 void removeAllImageShares(String providerImageId)
           
 void removeImageShare(String providerImageId, String accountNumber)
           
 void removePublicShare(String providerImageId)
           
 Iterable<MachineImage> searchImages(String accountNumber, String keyword, Platform platform, Architecture architecture, ImageClass... imageClasses)
           
 Iterable<MachineImage> searchMachineImages(String keyword, Platform platform, Architecture architecture)
          Deprecated. 
 Iterable<MachineImage> searchPublicImages(String keyword, Platform platform, Architecture architecture, ImageClass... imageClasses)
           
 void shareMachineImage(String templateId, String withAccountId, boolean allow)
          Deprecated. 
 boolean supportsCustomImages()
           
 boolean supportsDirectImageUpload()
           
 boolean supportsImageCapture(MachineImageType type)
           
 boolean supportsImageSharing()
           
 boolean supportsImageSharingWithPublic()
           
 boolean supportsPublicLibrary(ImageClass cls)
           
 void updateTags(String imageId, Tag... tags)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Templates

public Templates(CSCloud provider)
Method Detail

addImageShare

public void addImageShare(@Nonnull
                          String providerImageId,
                          @Nonnull
                          String accountNumber)
                   throws CloudException,
                          InternalException
Specified by:
addImageShare in interface MachineImageSupport
Throws:
CloudException
InternalException

addPublicShare

public void addPublicShare(@Nonnull
                           String providerImageId)
                    throws CloudException,
                           InternalException
Specified by:
addPublicShare in interface MachineImageSupport
Throws:
CloudException
InternalException

bundleVirtualMachine

@Nonnull
public String bundleVirtualMachine(@Nonnull
                                           String virtualMachineId,
                                           @Nonnull
                                           MachineImageFormat format,
                                           @Nonnull
                                           String bucket,
                                           @Nonnull
                                           String name)
                            throws CloudException,
                                   InternalException
Specified by:
bundleVirtualMachine in interface MachineImageSupport
Throws:
CloudException
InternalException

bundleVirtualMachineAsync

public void bundleVirtualMachineAsync(@Nonnull
                                      String virtualMachineId,
                                      @Nonnull
                                      MachineImageFormat format,
                                      @Nonnull
                                      String bucket,
                                      @Nonnull
                                      String name,
                                      @Nonnull
                                      AsynchronousTask<String> trackingTask)
                               throws CloudException,
                                      InternalException
Specified by:
bundleVirtualMachineAsync in interface MachineImageSupport
Throws:
CloudException
InternalException

captureImage

@Nonnull
public MachineImage captureImage(@Nonnull
                                         ImageCreateOptions options)
                          throws CloudException,
                                 InternalException
Specified by:
captureImage in interface MachineImageSupport
Throws:
CloudException
InternalException

captureImageAsync

public void captureImageAsync(@Nonnull
                              ImageCreateOptions options,
                              @Nonnull
                              AsynchronousTask<MachineImage> taskTracker)
                       throws CloudException,
                              InternalException
Specified by:
captureImageAsync in interface MachineImageSupport
Throws:
CloudException
InternalException

getImage

public MachineImage getImage(@Nonnull
                             String providerImageId)
                      throws CloudException,
                             InternalException
Specified by:
getImage in interface MachineImageSupport
Throws:
CloudException
InternalException

getMachineImage

@Deprecated
@Nullable
public MachineImage getMachineImage(@Nonnull
                                                        String templateId)
                             throws InternalException,
                                    CloudException
Deprecated. 

Specified by:
getMachineImage in interface MachineImageSupport
Throws:
InternalException
CloudException

getProviderTermForImage

@Deprecated
@Nonnull
public String getProviderTermForImage(@Nonnull
                                                         Locale locale)
Deprecated. 

Specified by:
getProviderTermForImage in interface MachineImageSupport

getProviderTermForImage

@Nonnull
public String getProviderTermForImage(@Nonnull
                                              Locale locale,
                                              @Nonnull
                                              ImageClass cls)
Specified by:
getProviderTermForImage in interface MachineImageSupport

hasPublicLibrary

public boolean hasPublicLibrary()
Specified by:
hasPublicLibrary in interface MachineImageSupport

identifyLocalBundlingRequirement

@Nonnull
public Requirement identifyLocalBundlingRequirement()
                                             throws CloudException,
                                                    InternalException
Specified by:
identifyLocalBundlingRequirement in interface MachineImageSupport
Throws:
CloudException
InternalException

imageVirtualMachine

@Deprecated
@Nonnull
public AsynchronousTask<String> imageVirtualMachine(@Nonnull
                                                                       String vmId,
                                                                       @Nonnull
                                                                       String name,
                                                                       @Nonnull
                                                                       String description)
                                             throws CloudException,
                                                    InternalException
Deprecated. 

Specified by:
imageVirtualMachine in interface MachineImageSupport
Throws:
CloudException
InternalException

isImageSharedWithPublic

public boolean isImageSharedWithPublic(@Nonnull
                                       String templateId)
                                throws CloudException,
                                       InternalException
Specified by:
isImageSharedWithPublic in interface MachineImageSupport
Throws:
CloudException
InternalException

isSubscribed

public boolean isSubscribed()
                     throws CloudException,
                            InternalException
Specified by:
isSubscribed in interface MachineImageSupport
Throws:
CloudException
InternalException

listImageStatus

@Nonnull
public Iterable<ResourceStatus> listImageStatus(@Nonnull
                                                        ImageClass cls)
                                         throws CloudException,
                                                InternalException
Specified by:
listImageStatus in interface MachineImageSupport
Throws:
CloudException
InternalException

listImages

@Nonnull
public Iterable<MachineImage> listImages(@Nonnull
                                                 ImageClass cls)
                                  throws CloudException,
                                         InternalException
Specified by:
listImages in interface MachineImageSupport
Throws:
CloudException
InternalException

listImages

@Nonnull
public Iterable<MachineImage> listImages(@Nonnull
                                                 ImageClass cls,
                                                 @Nonnull
                                                 String ownedBy)
                                  throws CloudException,
                                         InternalException
Specified by:
listImages in interface MachineImageSupport
Throws:
CloudException
InternalException

listMachineImages

@Deprecated
@Nonnull
public Iterable<MachineImage> listMachineImages()
                                         throws InternalException,
                                                CloudException
Deprecated. 

Specified by:
listMachineImages in interface MachineImageSupport
Throws:
InternalException
CloudException

listMachineImagesOwnedBy

@Deprecated
@Nonnull
public Iterable<MachineImage> listMachineImagesOwnedBy(@Nullable
                                                                          String accountId)
                                                throws CloudException,
                                                       InternalException
Deprecated. 

Specified by:
listMachineImagesOwnedBy in interface MachineImageSupport
Throws:
CloudException
InternalException

listShares

@Nonnull
public Iterable<String> listShares(@Nonnull
                                           String templateId)
                            throws CloudException,
                                   InternalException
Specified by:
listShares in interface MachineImageSupport
Throws:
CloudException
InternalException

listSupportedImageClasses

@Nonnull
public Iterable<ImageClass> listSupportedImageClasses()
                                               throws CloudException,
                                                      InternalException
Specified by:
listSupportedImageClasses in interface MachineImageSupport
Throws:
CloudException
InternalException

listSupportedImageTypes

@Nonnull
public Iterable<MachineImageType> listSupportedImageTypes()
                                                   throws CloudException,
                                                          InternalException
Specified by:
listSupportedImageTypes in interface MachineImageSupport
Throws:
CloudException
InternalException

registerImageBundle

@Nonnull
public MachineImage registerImageBundle(@Nonnull
                                                ImageCreateOptions options)
                                 throws CloudException,
                                        InternalException
Specified by:
registerImageBundle in interface MachineImageSupport
Throws:
CloudException
InternalException

listSupportedFormats

@Nonnull
public Iterable<MachineImageFormat> listSupportedFormats()
                                                  throws CloudException,
                                                         InternalException
Specified by:
listSupportedFormats in interface MachineImageSupport
Throws:
CloudException
InternalException

listSupportedFormatsForBundling

@Nonnull
public Iterable<MachineImageFormat> listSupportedFormatsForBundling()
                                                             throws CloudException,
                                                                    InternalException
Specified by:
listSupportedFormatsForBundling in interface MachineImageSupport
Throws:
CloudException
InternalException

mapServiceAction

@Nonnull
public String[] mapServiceAction(@Nonnull
                                         ServiceAction action)
Specified by:
mapServiceAction in interface AccessControlledService

remove

public void remove(@Nonnull
                   String templateId)
            throws InternalException,
                   CloudException
Specified by:
remove in interface MachineImageSupport
Throws:
InternalException
CloudException

removeAllImageShares

public void removeAllImageShares(@Nonnull
                                 String providerImageId)
                          throws CloudException,
                                 InternalException
Specified by:
removeAllImageShares in interface MachineImageSupport
Throws:
CloudException
InternalException

removeImageShare

public void removeImageShare(@Nonnull
                             String providerImageId,
                             @Nonnull
                             String accountNumber)
                      throws CloudException,
                             InternalException
Specified by:
removeImageShare in interface MachineImageSupport
Throws:
CloudException
InternalException

removePublicShare

public void removePublicShare(@Nonnull
                              String providerImageId)
                       throws CloudException,
                              InternalException
Specified by:
removePublicShare in interface MachineImageSupport
Throws:
CloudException
InternalException

searchMachineImages

@Deprecated
@Nonnull
public Iterable<MachineImage> searchMachineImages(@Nullable
                                                                     String keyword,
                                                                     @Nullable
                                                                     Platform platform,
                                                                     @Nullable
                                                                     Architecture architecture)
                                           throws InternalException,
                                                  CloudException
Deprecated. 

Specified by:
searchMachineImages in interface MachineImageSupport
Throws:
InternalException
CloudException

searchImages

@Nonnull
public Iterable<MachineImage> searchImages(@Nullable
                                                   String accountNumber,
                                                   @Nullable
                                                   String keyword,
                                                   @Nullable
                                                   Platform platform,
                                                   @Nullable
                                                   Architecture architecture,
                                                   @Nullable
                                                   ImageClass... imageClasses)
                                    throws CloudException,
                                           InternalException
Specified by:
searchImages in interface MachineImageSupport
Throws:
CloudException
InternalException

searchPublicImages

@Nonnull
public Iterable<MachineImage> searchPublicImages(@Nullable
                                                         String keyword,
                                                         @Nullable
                                                         Platform platform,
                                                         @Nullable
                                                         Architecture architecture,
                                                         @Nullable
                                                         ImageClass... imageClasses)
                                          throws CloudException,
                                                 InternalException
Specified by:
searchPublicImages in interface MachineImageSupport
Throws:
CloudException
InternalException

shareMachineImage

@Deprecated
public void shareMachineImage(@Nonnull
                                         String templateId,
                                         @Nullable
                                         String withAccountId,
                                         boolean allow)
                       throws CloudException,
                              InternalException
Deprecated. 

Specified by:
shareMachineImage in interface MachineImageSupport
Throws:
CloudException
InternalException

supportsCustomImages

public boolean supportsCustomImages()
Specified by:
supportsCustomImages in interface MachineImageSupport

supportsDirectImageUpload

public boolean supportsDirectImageUpload()
                                  throws CloudException,
                                         InternalException
Specified by:
supportsDirectImageUpload in interface MachineImageSupport
Throws:
CloudException
InternalException

supportsImageCapture

public boolean supportsImageCapture(@Nonnull
                                    MachineImageType type)
                             throws CloudException,
                                    InternalException
Specified by:
supportsImageCapture in interface MachineImageSupport
Throws:
CloudException
InternalException

supportsImageSharing

public boolean supportsImageSharing()
Specified by:
supportsImageSharing in interface MachineImageSupport

supportsImageSharingWithPublic

public boolean supportsImageSharingWithPublic()
Specified by:
supportsImageSharingWithPublic in interface MachineImageSupport

supportsPublicLibrary

public boolean supportsPublicLibrary(@Nonnull
                                     ImageClass cls)
                              throws CloudException,
                                     InternalException
Specified by:
supportsPublicLibrary in interface MachineImageSupport
Throws:
CloudException
InternalException

updateTags

public void updateTags(@Nonnull
                       String imageId,
                       @Nonnull
                       Tag... tags)
                throws CloudException,
                       InternalException
Specified by:
updateTags in interface MachineImageSupport
Throws:
CloudException
InternalException


Copyright © 2012 enStratus Networks Inc. All Rights Reserved.