Search in sources :

Example 1 with GetVmTemplateParameters

use of org.ovirt.engine.core.common.queries.GetVmTemplateParameters in project ovirt-engine by oVirt.

the class BackendTemplateCdromResource method get.

@Override
public Cdrom get() {
    GetVmTemplateParameters parameters = new GetVmTemplateParameters(templateId);
    VmTemplate entity = getEntity(VmTemplate.class, QueryType.GetVmTemplate, parameters, templateId.toString(), true);
    return addLinks(populate(map(entity), entity));
}
Also used : GetVmTemplateParameters(org.ovirt.engine.core.common.queries.GetVmTemplateParameters) VmTemplate(org.ovirt.engine.core.common.businessentities.VmTemplate)

Example 2 with GetVmTemplateParameters

use of org.ovirt.engine.core.common.queries.GetVmTemplateParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getVmTemplatesByBaseTemplateId.

public void getVmTemplatesByBaseTemplateId(AsyncQuery<List<VmTemplate>> asyncQuery, Guid baseTemplate) {
    asyncQuery.converterCallback = new ListConverter<>();
    Frontend.getInstance().runQuery(QueryType.GetVmTemplatesByBaseTemplateId, new GetVmTemplateParameters(baseTemplate), asyncQuery);
}
Also used : GetVmTemplateParameters(org.ovirt.engine.core.common.queries.GetVmTemplateParameters)

Example 3 with GetVmTemplateParameters

use of org.ovirt.engine.core.common.queries.GetVmTemplateParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getTemplateById.

public void getTemplateById(AsyncQuery<VmTemplate> aQuery, Guid templateId) {
    aQuery.converterCallback = new CastingConverter<>();
    Frontend.getInstance().runQuery(QueryType.GetVmTemplate, new GetVmTemplateParameters(templateId), aQuery);
}
Also used : GetVmTemplateParameters(org.ovirt.engine.core.common.queries.GetVmTemplateParameters)

Example 4 with GetVmTemplateParameters

use of org.ovirt.engine.core.common.queries.GetVmTemplateParameters in project ovirt-engine by oVirt.

the class BackendVmPoolsResource method loadInstanceType.

private org.ovirt.engine.core.common.businessentities.InstanceType loadInstanceType(VmPool pool) {
    validateParameters(pool.getInstanceType(), "id|name");
    GetVmTemplateParameters params;
    String identifier;
    InstanceType instanceType = pool.getInstanceType();
    if (instanceType.isSetId()) {
        params = new GetVmTemplateParameters(asGuid(instanceType.getId()));
        identifier = "InstanceType: id=" + instanceType.getId();
    } else {
        params = new GetVmTemplateParameters(instanceType.getName());
        identifier = "InstanceType: name=" + instanceType.getName();
    }
    return getEntity(VmTemplate.class, QueryType.GetInstanceType, params, identifier);
}
Also used : GetVmTemplateParameters(org.ovirt.engine.core.common.queries.GetVmTemplateParameters) InstanceType(org.ovirt.engine.api.model.InstanceType)

Example 5 with GetVmTemplateParameters

use of org.ovirt.engine.core.common.queries.GetVmTemplateParameters in project ovirt-engine by oVirt.

the class BackendVmPoolsResource method getVmTemplate.

protected VmTemplate getVmTemplate(VmPool pool) {
    if (pool.getTemplate().isSetId()) {
        return getEntity(VmTemplate.class, QueryType.GetVmTemplate, new GetVmTemplateParameters(asGuid(pool.getTemplate().getId())), pool.getTemplate().getId());
    } else {
        GetVmTemplateParameters params = new GetVmTemplateParameters(pool.getTemplate().getName());
        params.setClusterId(asGuid(pool.getCluster().getId()));
        return getEntity(VmTemplate.class, QueryType.GetVmTemplate, params, "Template: name=" + pool.getTemplate().getName());
    }
}
Also used : GetVmTemplateParameters(org.ovirt.engine.core.common.queries.GetVmTemplateParameters)

Aggregations

GetVmTemplateParameters (org.ovirt.engine.core.common.queries.GetVmTemplateParameters)10 VmTemplate (org.ovirt.engine.core.common.businessentities.VmTemplate)3 Guid (org.ovirt.engine.core.compat.Guid)3 InstanceType (org.ovirt.engine.api.model.InstanceType)2 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)1 InstanceType (org.ovirt.engine.core.common.businessentities.InstanceType)1 VM (org.ovirt.engine.core.common.businessentities.VM)1 VmStatic (org.ovirt.engine.core.common.businessentities.VmStatic)1 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)1 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)1