use of org.ovirt.engine.api.model.Qos in project ovirt-engine by oVirt.
the class AbstractBackendCpuProfilesResource method handleQosDataCenterLinks.
/**
* used to set qos's href (requires dc id).
*/
private void handleQosDataCenterLinks(Map<Guid, Qos> qosMap) {
if (!qosMap.isEmpty()) {
List<CpuQos> list = getBackendCollection(CpuQos.class, QueryType.GetAllQosByType, new QosQueryParameterBase(null, QosType.CPU));
for (CpuQos cpuQos : list) {
Qos qos = qosMap.get(cpuQos.getId());
if (qos != null) {
qos.setDataCenter(new DataCenter());
qos.getDataCenter().setId(cpuQos.getStoragePoolId().toString());
}
}
}
}
use of org.ovirt.engine.api.model.Qos in project ovirt-engine by oVirt.
the class AbstractBackendDiskProfilesResource method handleQosDataCenterLinks.
/**
* used to set qos's href (requires dc id).
*/
private void handleQosDataCenterLinks(Map<Guid, Qos> qosMap) {
if (!qosMap.isEmpty()) {
List<StorageQos> list = getBackendCollection(StorageQos.class, QueryType.GetAllQosByType, new QosQueryParameterBase(null, QosType.STORAGE));
for (StorageQos storageQos : list) {
Qos qos = qosMap.get(storageQos.getId());
if (qos != null) {
qos.setDataCenter(new DataCenter());
qos.getDataCenter().setId(storageQos.getStoragePoolId().toString());
}
}
}
}
use of org.ovirt.engine.api.model.Qos in project ovirt-engine by oVirt.
the class AbstractBackendVnicProfilesResource method mapCollection.
protected VnicProfiles mapCollection(List<org.ovirt.engine.core.common.businessentities.network.VnicProfile> entities) {
VnicProfiles collection = new VnicProfiles();
Map<Guid, Qos> qosMap = new HashMap<>();
for (org.ovirt.engine.core.common.businessentities.network.VnicProfile entity : entities) {
VnicProfile profile = populate(map(entity), entity);
collection.getVnicProfiles().add(profile);
if (entity.getNetworkQosId() != null) {
qosMap.put(entity.getNetworkQosId(), profile.getQos());
}
}
handleQosDataCenterLinks(qosMap);
for (VnicProfile vnicProfile : collection.getVnicProfiles()) {
addLinks(vnicProfile);
}
return collection;
}
use of org.ovirt.engine.api.model.Qos in project ovirt-engine by oVirt.
the class AbstractBackendVnicProfilesResource method handleQosDataCenterLinks.
/**
* used to set qos's href (requires dc id).
*/
private void handleQosDataCenterLinks(Map<Guid, Qos> qosMap) {
if (!qosMap.isEmpty()) {
List<NetworkQoS> list = getBackendCollection(NetworkQoS.class, QueryType.GetAllQosByType, new QosQueryParameterBase(null, QosType.NETWORK));
for (NetworkQoS networkQoS : list) {
Qos qos = qosMap.get(networkQoS.getId());
if (qos != null) {
qos.setDataCenter(new DataCenter());
qos.getDataCenter().setId(networkQoS.getStoragePoolId().toString());
}
}
}
}
use of org.ovirt.engine.api.model.Qos in project ovirt-engine by oVirt.
the class BackendQosResource method get.
@Override
public Qos get() {
IdQueryParameters params = new IdQueryParameters(guid);
Qos qos = performGet(QueryType.GetQosById, params);
return qos;
}
Aggregations