Search in sources :

Example 11 with NameQueryParameters

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

the class BackendExternalVmImportsResource method getStorageDomainId.

private Guid getStorageDomainId(ExternalVmImport vmImport) {
    if (vmImport.getStorageDomain().isSetId()) {
        return asGuid(vmImport.getStorageDomain().getId());
    } else /* if (vmImport.getStorageDomain().isSetName()) */
    {
        String storageDomainName = vmImport.getStorageDomain().getName();
        StorageDomainStatic storageDomain = getEntity(StorageDomainStatic.class, QueryType.GetStorageDomainByName, new NameQueryParameters(storageDomainName), storageDomainName, true);
        return storageDomain.getId();
    }
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) NameQueryParameters(org.ovirt.engine.core.common.queries.NameQueryParameters)

Aggregations

NameQueryParameters (org.ovirt.engine.core.common.queries.NameQueryParameters)11 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)4 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)3 StorageDomainStatic (org.ovirt.engine.core.common.businessentities.StorageDomainStatic)2 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)2 Guid (org.ovirt.engine.core.compat.Guid)2 MalformedIdException (org.ovirt.engine.api.restapi.utils.MalformedIdException)1 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)1