use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class BackendGlusterBricksResource method populateAdvancedDetails.
protected GlusterBrick populateAdvancedDetails(GlusterBrick model, GlusterBrickEntity entity) {
GlusterVolumeEntity volumeEntity = getEntity(GlusterVolumeEntity.class, QueryType.GetGlusterVolumeById, new IdQueryParameters(entity.getVolumeId()), null, true);
GlusterVolumeAdvancedDetails detailsEntity = getEntity(GlusterVolumeAdvancedDetails.class, QueryType.GetGlusterVolumeAdvancedDetails, new GlusterVolumeAdvancedDetailsParameters(volumeEntity.getClusterId(), volumeEntity.getId(), entity.getId(), true), null, true);
model = getMapper(GlusterVolumeAdvancedDetails.class, GlusterBrick.class).map(detailsEntity, model);
return model;
}
use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class BackendOpenStackNetworksResource method getBackendCollection.
private Map<Network, Set<Guid>> getBackendCollection() {
try {
IdQueryParameters parameters = new IdQueryParameters(asGuid(providerId));
QueryReturnValue result = runQuery(QueryType.GetAllExternalNetworksOnProvider, parameters);
if (!result.getSucceeded()) {
backendFailure(result.getExceptionString());
}
return result.getReturnValue();
} catch (Exception exception) {
return handleError(exception, false);
}
}
use of org.ovirt.engine.core.common.queries.IdQueryParameters 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.IdQueryParameters 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.IdQueryParameters in project ovirt-engine by oVirt.
the class BackendOpenStackVolumeTypesResource method list.
@Override
public OpenStackVolumeTypes list() {
Guid storageDomainId = BackendOpenStackStorageProviderHelper.getStorageDomainId(this, providerId);
IdQueryParameters parameters = new IdQueryParameters(storageDomainId);
return mapCollection(getBackendCollection(QueryType.GetCinderVolumeTypesByStorageDomainId, parameters));
}
Aggregations