services.InstanceTypesService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of model Show documentation
Show all versions of model Show documentation
Model management tools for the oVirt Engine API.
/*
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 services;
import annotations.Area;
import mixins.Follow;
import org.ovirt.api.metamodel.annotations.In;
import org.ovirt.api.metamodel.annotations.InputDetail;
import org.ovirt.api.metamodel.annotations.Out;
import org.ovirt.api.metamodel.annotations.Service;
import types.InstanceType;
import static org.ovirt.api.metamodel.language.ApiLanguage.mandatory;
import static org.ovirt.api.metamodel.language.ApiLanguage.optional;
@Service
@Area("Virtualization")
public interface InstanceTypesService {
/**
* Creates a new instance type.
*
* This requires only a name attribute and can include all hardware configurations of the
* virtual machine.
*
* [source]
* ----
* POST /ovirt-engine/api/instancetypes
* ----
*
* With a request body like this:
*
* [source,xml]
* ----
*
* myinstancetype
*
* ----
*
* Creating an instance type with all hardware configurations with a request body like this:
*
* [source,xml]
* ----
*
* myinstancetype
*
* true
*
*
*
* 2
* 2
* 1
*
*
* AMD Opteron_G2
* q35
*
* 1
* true
* true
* spice
*
*
* true
* 1
*
*
* 2
*
* 4294967296
*
* true
* 268435456
*
*
* inherit
* inherit
*
*
* 2
*
*
*
* hd
*
*
*
*
*
* 200
* 2
*
*
*
* true
*
* true
* native
*
*
* true
*
*
* ----
*
* @author Sefi Litmanovich
* @date 12 Dec 2016
* @status added
*/
interface Add {
@InputDetail
default void inputDetail() {
mandatory(instanceType().name());
optional(instanceType().console().enabled());
optional(instanceType().cpu().architecture());
optional(instanceType().cpu().topology().cores());
optional(instanceType().cpu().topology().sockets());
optional(instanceType().cpu().topology().threads());
optional(instanceType().cpuShares());
optional(instanceType().customCpuModel());
optional(instanceType().customEmulatedMachine());
optional(instanceType().description());
optional(instanceType().display().monitors());
optional(instanceType().display().smartcardEnabled());
optional(instanceType().display().type());
optional(instanceType().highAvailability().enabled());
optional(instanceType().highAvailability().priority());
optional(instanceType().io().threads());
optional(instanceType().memory());
optional(instanceType().memoryPolicy().ballooning());
optional(instanceType().memoryPolicy().guaranteed());
optional(instanceType().migrationDowntime());
optional(instanceType().origin());
optional(instanceType().soundcardEnabled());
optional(instanceType().usb().enabled());
optional(instanceType().usb().type());
optional(instanceType().virtioScsi().enabled());
optional(instanceType().storageErrorResumeBehaviour());
// optional(instanceType().singleQxlPci()); //TODO: check
// optional(instanceType().os()[COLLECTION].dev()); //TODO: check
}
@In @Out InstanceType instanceType();
}
/**
* Lists all existing instance types in the system.
*
* The order of the returned list of instance types isn't guaranteed.
*
* @author Sefi Litmanovich
* @date 12 Dec 2016
* @status added
*/
interface List extends Follow {
@Out InstanceType[] instanceType();
/**
* Sets the maximum number of instance types to return. If not specified all the instance
* types are returned.
*/
@In Integer max();
/**
* A query string used to restrict the returned templates.
*
* @author Sefi Litmanovich
* @date 12 Dec 2016
* @status added
*/
@In String search();
/**
* Indicates if the search performed using the `search` parameter should be performed
* taking case into account. The default value is `true`, which means that case is taken
* into account. If you want to search ignoring case set it to `false`.
*
* @author Sefi Litmanovich
* @date 12 Dec 2016
* @status added
*/
@In Boolean caseSensitive();
}
@Service InstanceTypeService instanceType(String id);
}