Search in sources :

Example 1 with QosType

use of org.ovirt.engine.api.model.QosType 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));
}
Also used : QosBase(org.ovirt.engine.core.common.businessentities.qos.QosBase) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) QosParametersBase(org.ovirt.engine.core.common.action.QosParametersBase) Guid(org.ovirt.engine.core.compat.Guid) QosType(org.ovirt.engine.api.model.QosType)

Aggregations

QosType (org.ovirt.engine.api.model.QosType)1 QosParametersBase (org.ovirt.engine.core.common.action.QosParametersBase)1 QosBase (org.ovirt.engine.core.common.businessentities.qos.QosBase)1 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)1 Guid (org.ovirt.engine.core.compat.Guid)1