use of org.ovirt.engine.core.common.queries.NameQueryParameters in project ovirt-engine by oVirt.
the class BackendOpenStackVolumeProvidersResource method getStoragePoolIdByStorageDomainName.
private StoragePool getStoragePoolIdByStorageDomainName(String storageDomainName) {
StorageDomainStatic storageDomain = getEntity(StorageDomainStatic.class, QueryType.GetStorageDomainByName, new NameQueryParameters(storageDomainName), "StorageDomain: name=" + storageDomainName);
List<StoragePool> storagePools = getEntity(List.class, QueryType.GetStoragePoolsByStorageDomainId, new IdQueryParameters(storageDomain.getId()), "Datacenters");
if (!storagePools.isEmpty()) {
return storagePools.get(0);
}
// The storage domain is unattached
return null;
}
use of org.ovirt.engine.core.common.queries.NameQueryParameters in project ovirt-engine by oVirt.
the class BackendOpenStackVolumeProvidersResource method getStoragePool.
public StoragePool getStoragePool(DataCenter dataCenter) {
StoragePool pool = null;
if (dataCenter.isSetId()) {
Guid id = asGuid(dataCenter.getId());
pool = getEntity(StoragePool.class, QueryType.GetStoragePoolById, new IdQueryParameters(id), "Datacenter: id=" + dataCenter.getId());
} else if (dataCenter.isSetName()) {
pool = getEntity(StoragePool.class, QueryType.GetStoragePoolByDatacenterName, new NameQueryParameters(dataCenter.getName()), "Datacenter: name=" + dataCenter.getName());
}
if (pool == null) {
notFound(DataCenter.class);
}
return pool;
}
use of org.ovirt.engine.core.common.queries.NameQueryParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method isPoolNameUnique.
public void isPoolNameUnique(AsyncQuery<Boolean> aQuery, String name) {
aQuery.converterCallback = source -> {
if (source != null) {
return !(Boolean) source;
}
return false;
};
Frontend.getInstance().runQuery(QueryType.IsVmPoolWithSameNameExists, new NameQueryParameters(name), aQuery);
}
use of org.ovirt.engine.core.common.queries.NameQueryParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method isTemplateNameUnique.
public void isTemplateNameUnique(AsyncQuery<Boolean> aQuery, String templateName, Guid datacenterId) {
aQuery.converterCallback = source -> source != null && !(Boolean) source;
NameQueryParameters params = new NameQueryParameters(templateName);
params.setDatacenterId(datacenterId);
Frontend.getInstance().runQuery(QueryType.IsVmTemlateWithSameNameExist, params, aQuery);
}
use of org.ovirt.engine.core.common.queries.NameQueryParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getStorageDomainByName.
public void getStorageDomainByName(AsyncQuery<StorageDomainStatic> aQuery, String storageDomainName) {
aQuery.converterCallback = new CastingConverter<>();
Frontend.getInstance().runQuery(QueryType.GetStorageDomainByName, new NameQueryParameters(storageDomainName), aQuery);
}
Aggregations