Class TemplatesServiceImpl

    • Constructor Detail

    • Method Detail

      • add

        public TemplatesService.AddRequest add()
        Description copied from interface: TemplatesService
        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] ---- ----
        Specified by:
        add in interface TemplatesService
      • list

        public TemplatesService.ListRequest list()
        Description copied from interface: TemplatesService
        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.
        Specified by:
        list in interface TemplatesService