Interface TemplatesService

  • All Superinterfaces:
    Service
    All Known Implementing Classes:
    TemplatesServiceImpl

    public interface TemplatesService
    extends Service
    This service manages the virtual machine templates available in the system.
    • Method Detail

      • add

        TemplatesService.AddRequest add()
        Creates a new template. This requires the `name` and `vm` elements. To identify the virtual machine use the `vm.id` or `vm.name` attributes. For example, to create a template from a virtual machine with the identifier `123` send a request like this: [source] ---- POST /ovirt-engine/api/templates ---- With a request body like this: [source,xml] ---- ---- Since version 4.3, in order to create virtual machine template from a snapshot send a request body like this: [source,xml] ---- ---- The disks of the template can be customized, making some of their characteristics different from the disks of the original virtual machine. To do so use the `vm.disk_attachments` attribute, specifying the identifier of the disk of the original virtual machine and the characteristics that you want to change. For example, if the original virtual machine has a disk with the identifier `456`, and, for that disk, you want to change the name to `mydisk` the format to <> and make it <>, send a request body like this: [source,xml] ---- ---- The template can be created as a sub-version of an existing template. This requires the `name` and `vm` attributes for the new template, and the `base_template` and `version_name` attributes for the new template version. The `base_template` and `version_name` attributes must be specified within a `version` section enclosed in the `template` section. Identify the virtual machine with the `id` or `name` attributes. [source,xml] ---- ---- The destination storage domain of the template can be customized, in one of two ways: 1. Globally, at the request level. The request must list the desired disk attachments to be created on the storage domain. If the disk attachments are not listed, the global storage domain parameter will be ignored. + [source,xml] ---- ---- 2. Per each disk attachment. Specify the desired storage domain for each disk attachment. Specifying the global storage definition will override the storage domain per disk attachment specification. + [source,xml] ---- ----
      • addFromConfiguration

        TemplatesService.AddFromConfigurationRequest addFromConfiguration()
        Add a virtual machine template to the system from a configuration. Requires the configuration type, the configuration data, and the target cluster.
      • list

        TemplatesService.ListRequest list()
        Returns the list of virtual machine templates. For example: [source] ---- GET /ovirt-engine/api/templates ---- Will return the list of virtual machines and virtual machine templates. The order of the returned list of templates is not guaranteed.
      • templateService

        TemplateService templateService​(String id)
        Returns a reference to the service that manages a specific virtual machine template.
      • service

        Service service​(String path)
        Service locator method, returns individual service on which the URI is dispatched.