use of org.ovirt.engine.core.common.businessentities.qos.QosBase in project ovirt-engine by oVirt.
the class AbstractBackendDiskProfileResource method addLinks.
@Override
protected DiskProfile addLinks(DiskProfile model, Class<? extends BaseResource> suggestedParent, String... subCollectionMembersToExclude) {
if (model.isSetQos() && model.getQos().isSetId()) {
QosBase qos = getEntity(QosBase.class, QueryType.GetQosById, new IdQueryParameters(asGuid(model.getQos().getId())), "qos");
model.getQos().setDataCenter(new DataCenter());
model.getQos().getDataCenter().setId(qos.getStoragePoolId().toString());
}
return super.addLinks(model, suggestedParent, subCollectionMembersToExclude);
}
use of org.ovirt.engine.core.common.businessentities.qos.QosBase in project ovirt-engine by oVirt.
the class BackendQossResource method add.
@Override
public Response add(Qos qos) {
validateParameters(qos, "name", "type");
QosParametersBase<QosBase> params = new QosParametersBase<>();
org.ovirt.engine.api.model.QosType qosType = qos.getType();
QosBase qosEntity = createNewQosEntityForQosType(qosType);
params.setQos(map(qos, qosEntity));
if (dataCenterId != null) {
qosEntity.setStoragePoolId(dataCenterId);
}
return performCreate(addActionTypeForQosType(qosType), params, new QueryIdResolver<Guid>(QueryType.GetQosById, IdQueryParameters.class));
}
use of org.ovirt.engine.core.common.businessentities.qos.QosBase in project ovirt-engine by oVirt.
the class AbstractBackendVnicProfileResource method addLinks.
@Override
protected VnicProfile addLinks(VnicProfile model, Class<? extends BaseResource> suggestedParent, String... subCollectionMembersToExclude) {
if (model.isSetQos() && model.getQos().isSetId()) {
QosBase qos = getEntity(QosBase.class, QueryType.GetQosById, new IdQueryParameters(asGuid(model.getQos().getId())), "qos");
model.getQos().setDataCenter(new DataCenter());
model.getQos().getDataCenter().setId(qos.getStoragePoolId().toString());
}
return super.addLinks(model, suggestedParent, subCollectionMembersToExclude);
}
use of org.ovirt.engine.core.common.businessentities.qos.QosBase in project ovirt-engine by oVirt.
the class AbstractBackendCpuProfileResource method addLinks.
@Override
protected CpuProfile addLinks(CpuProfile model, Class<? extends BaseResource> suggestedParent, String... subCollectionMembersToExclude) {
if (model.isSetQos() && model.getQos().isSetId()) {
QosBase qos = getEntity(QosBase.class, QueryType.GetQosById, new IdQueryParameters(asGuid(model.getQos().getId())), "qos");
model.getQos().setDataCenter(new DataCenter());
model.getQos().getDataCenter().setId(qos.getStoragePoolId().toString());
}
return super.addLinks(model, suggestedParent, subCollectionMembersToExclude);
}
use of org.ovirt.engine.core.common.businessentities.qos.QosBase in project ovirt-engine by oVirt.
the class BackendQosResource method update.
@Override
public Qos update(final Qos incoming) {
QueryIdResolver<Guid> entityResolver = new QueryIdResolver<>(QueryType.GetQosById, IdQueryParameters.class);
final QosBase qosBase = getEntity(new QueryIdResolver<>(QueryType.GetQosById, IdQueryParameters.class), true);
return performUpdate(incoming, entityResolver, updateActionTypeForQosType(qosBase.getQosType()), (model, entity) -> {
QosParametersBase<QosBase> parameters = new QosParametersBase<>();
parameters.setQosId(guid);
parameters.setQos(map(incoming, entity));
return parameters;
});
}
Aggregations