All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ovirt.engine.sdk4.services.TemplateService Maven / Gradle / Ivy

/*
Copyright (c) 2015 Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package org.ovirt.engine.sdk4.services;

import java.io.IOException;
import org.ovirt.engine.sdk4.Request;
import org.ovirt.engine.sdk4.Response;
import org.ovirt.engine.sdk4.Service;
import org.ovirt.engine.sdk4.builders.HostBuilder;
import org.ovirt.engine.sdk4.builders.StorageDomainBuilder;
import org.ovirt.engine.sdk4.builders.TemplateBuilder;
import org.ovirt.engine.sdk4.types.Host;
import org.ovirt.engine.sdk4.types.StorageDomain;
import org.ovirt.engine.sdk4.types.Template;

/**
 * Manages the virtual machine template and template versions.
 */
public interface TemplateService extends Service {
    /**
     * Exports a template to the data center export domain.
     * 
     * For example, send the following request:
     * 
     * [source]
     * ----
     * POST /ovirt-engine/api/templates/123/export
     * ----
     * 
     * With a request body like this:
     * 
     * [source,xml]
     * ----
     * 
     *   
     *   true
     * 
     * ----
     */
    public interface ExportRequest extends Request {
        /**
         * Indicates if the existing templates with the same name should be overwritten.
         * 
         * The export action reports a failed action if a template of the same name exists in the destination domain.
         * Set this parameter to `true` to change this behavior and overwrite any existing template.
         */
        ExportRequest exclusive(Boolean exclusive);
        ExportRequest storageDomain(StorageDomain storageDomain);
        /**
         * Specifies the destination export storage domain.
         */
        ExportRequest storageDomain(StorageDomainBuilder storageDomain);
    }
    
    /**
     * Exports a template to the data center export domain.
     * 
     * For example, send the following request:
     * 
     * [source]
     * ----
     * POST /ovirt-engine/api/templates/123/export
     * ----
     * 
     * With a request body like this:
     * 
     * [source,xml]
     * ----
     * 
     *   
     *   true
     * 
     * ----
     */
    public interface ExportResponse extends Response {
    }
    
    /**
     * Exports a template to the data center export domain.
     * 
     * For example, send the following request:
     * 
     * [source]
     * ----
     * POST /ovirt-engine/api/templates/123/export
     * ----
     * 
     * With a request body like this:
     * 
     * [source,xml]
     * ----
     * 
     *   
     *   true
     * 
     * ----
     */
    ExportRequest export();
    
    /**
     * Returns the information about this template or template version.
     */
    public interface GetRequest extends Request {
        /**
         * Indicates if the results should be filtered according to the permissions of the user.
         */
        GetRequest filter(Boolean filter);
        /**
         * Indicates which inner links should be _followed_. The objects referenced by these links will be fetched as part
         * of the current request. See <> for details.
         */
        GetRequest follow(String follow);
    }
    
    /**
     * Returns the information about this template or template version.
     */
    public interface GetResponse extends Response {
        /**
         * The information about the template or template version.
         */
        Template template();
    }
    
    /**
     * Returns the information about this template or template version.
     */
    GetRequest get();
    
    /**
     * Removes a virtual machine template.
     * 
     * [source]
     * ----
     * DELETE /ovirt-engine/api/templates/123
     * ----
     */
    public interface RemoveRequest extends Request {
        /**
         * Indicates if the removal should be performed asynchronously.
         */
        RemoveRequest async(Boolean async);
    }
    
    /**
     * Removes a virtual machine template.
     * 
     * [source]
     * ----
     * DELETE /ovirt-engine/api/templates/123
     * ----
     */
    public interface RemoveResponse extends Response {
    }
    
    /**
     * Removes a virtual machine template.
     * 
     * [source]
     * ----
     * DELETE /ovirt-engine/api/templates/123
     * ----
     */
    RemoveRequest remove();
    
    /**
     * Exports a template to an export domain.
     */
    public interface ExportToExportDomainRequest extends Request {
        /**
         * Indicates if the existing templates with the same name should be overwritten.
         * 
         * The export action reports a failed action if a template of the same name exists in the destination domain.
         * Set this parameter to `true` to change this behavior and overwrite any existing template.
         */
        ExportToExportDomainRequest exclusive(Boolean exclusive);
        ExportToExportDomainRequest storageDomain(StorageDomain storageDomain);
        /**
         * Specifies the destination export storage domain.
         */
        ExportToExportDomainRequest storageDomain(StorageDomainBuilder storageDomain);
    }
    
    /**
     * Exports a template to an export domain.
     */
    public interface ExportToExportDomainResponse extends Response {
    }
    
    /**
     * Exports a template to an export domain.
     */
    ExportToExportDomainRequest exportToExportDomain();
    
    /**
     * Exports a template as an OVA file to a given path on a specified host.
     */
    public interface ExportToPathOnHostRequest extends Request {
        /**
         * An absolute path of a directory on the host to generate the OVA file in.
         */
        ExportToPathOnHostRequest directory(String directory);
        /**
         * Indicates if the existing templates with the same name should be overwritten.
         * 
         * The export action reports a failed action if a template of the same name exists in the destination domain.
         * Set this parameter to `true` to change this behavior and overwrite any existing template.
         */
        ExportToPathOnHostRequest exclusive(Boolean exclusive);
        /**
         * The name of the OVA file.
         * 
         * This is an optional parameter. If it is not specified, the name of the OVA file is determined according
         * to the name of the template. It will conform to the following pattern: "