org.jclouds.cloudstack.features
Interface TemplateClient


public interface TemplateClient

Provides synchronous access to CloudStack template features.

Author:
Adrian Cole
See Also:
TemplateAsyncClient,

Method Summary
 AsyncCreateResponse copyTemplateToZone(long id, long sourceZoneId, long destZoneId)
          Copies a template from one zone to another.
 AsyncCreateResponse createTemplate(TemplateMetadata templateMetadata, CreateTemplateOptions... options)
          Creates a template of a virtual machine.
 AsyncCreateResponse deleteTemplate(long id, DeleteTemplateOptions... options)
          Deletes a template from the system.
 AsyncCreateResponse extractTemplate(long id, ExtractMode mode, long zoneId, ExtractTemplateOptions... options)
           
 Template getTemplateInZone(long templateId, long zoneId)
          get a specific template by id
 Set<TemplatePermission> listTemplatePermissions(long id, AccountInDomainOptions... options)
          List template visibility and all accounts that have permissions to view this template.
 Set<Template> listTemplates()
          List all executable templates.
 Set<Template> listTemplates(ListTemplatesOptions options)
          List all public, private, and privileged templates.
 Set<Template> registerTemplate(TemplateMetadata templateMetadata, String format, String hypervisor, String url, long zoneId, RegisterTemplateOptions... options)
          Registers an existing template into the Cloud.com cloud.
 Template updateTemplate(long id, UpdateTemplateOptions... options)
          Updates attributes of a template.
 void updateTemplatePermissions(long id, UpdateTemplatePermissionsOptions... options)
          Updates a template visibility permissions.
 

Method Detail

createTemplate

AsyncCreateResponse createTemplate(TemplateMetadata templateMetadata,
                                   CreateTemplateOptions... options)
Creates a template of a virtual machine. The virtual machine must be in a STOPPED state. A template created from this command is automatically designated as a private template visible to the account that created it.

Parameters:
templateMetadata - overall description of the template
options - optional arguments
Returns:
an asynchronous job response
See Also:
://download.cloud.com/releases/2.2.0/api_2.2.8/user/createTemplate .html

registerTemplate

Set<Template> registerTemplate(TemplateMetadata templateMetadata,
                               String format,
                               String hypervisor,
                               String url,
                               long zoneId,
                               RegisterTemplateOptions... options)
Registers an existing template into the Cloud.com cloud.

Parameters:
templateMetadata - overall description of the template
format - the format for the template. Possible values include QCOW2, RAW, and VHD.
url - the URL of where the template is hosted. Possible URL include http:// and https://
zoneId - the ID of the zone the template is to be hosted on
options - optional arguments
Returns:
data about the newly-registered template
See Also:
://download.cloud.com/releases/2.2.0/api_2.2.8/user/registerTemplate .html

updateTemplate

Template updateTemplate(long id,
                        UpdateTemplateOptions... options)
Updates attributes of a template.

Parameters:
id - the ID of the image file
options - optional arguments
Returns:
updated data about the template
See Also:
://download.cloud.com/releases/2.2.0/api_2.2.8/user/updateTemplate .html

copyTemplateToZone

AsyncCreateResponse copyTemplateToZone(long id,
                                       long sourceZoneId,
                                       long destZoneId)
Copies a template from one zone to another.

Parameters:
id - Template ID.
sourceZoneId - ID of the zone the template is currently hosted on.
destZoneId - ID of the zone the template is being copied to.
Returns:
an asynchronous job response
See Also:
://download.cloud.com/releases/2.2.0/api_2.2.8/user/copyTemplate.html

deleteTemplate

AsyncCreateResponse deleteTemplate(long id,
                                   DeleteTemplateOptions... options)
Deletes a template from the system. All virtual machines using the deleted template will not be affected.

Parameters:
id - the ID of the template
options - optional arguments
See Also:
://download.cloud.com/releases/2.2.0/api_2.2.8/user/deleteTemplate .html

listTemplates

Set<Template> listTemplates()
List all executable templates.

Returns:
all executable templates, or empty set, if no templates are found
See Also:
://download.cloud.com/releases/2.2.0/api_2.2.8/user/listTemplates. html

listTemplates

Set<Template> listTemplates(ListTemplatesOptions options)
List all public, private, and privileged templates.

Parameters:
options - if present, how to constrain the list, defaults to all executable templates
Returns:
templates matching query, or empty set, if no templates are found
See Also:
://download.cloud.com/releases/2.2.0/api_2.2.8/user/listTemplates. html, TemplateFilter

getTemplateInZone

Template getTemplateInZone(long templateId,
                           long zoneId)
get a specific template by id

Parameters:
templateId -
zoneId - zone template is defined in
Returns:
template or null if not found

updateTemplatePermissions

void updateTemplatePermissions(long id,
                               UpdateTemplatePermissionsOptions... options)
Updates a template visibility permissions. A public template is visible to all accounts within the same domain. A private template is visible only to the owner of the template. A priviledged template is a private template with account permissions added. Only accounts specified under the template permissions are visible to them.

Parameters:
id - the template ID
options - optional arguments
See Also:
updateTemplatePermissions.html

listTemplatePermissions

Set<TemplatePermission> listTemplatePermissions(long id,
                                                AccountInDomainOptions... options)
List template visibility and all accounts that have permissions to view this template.

Parameters:
id - the template ID
options - optional arguments
Returns:
the list of permissions that apply to the template
See Also:
listTemplatePermissions.html

extractTemplate

AsyncCreateResponse extractTemplate(long id,
                                    ExtractMode mode,
                                    long zoneId,
                                    ExtractTemplateOptions... options)
Parameters:
id - the ID of the template
mode - FIXME the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD
zoneId - the ID of the zone where the ISO is originally located
options - optional arguments
Returns:
an asynchronous job response
See Also:
://download.cloud.com/releases/2.2.0/api_2.2.8/user/extractTemplate .html


Copyright © 2009-2012 jclouds. All Rights Reserved.