use of org.ovirt.engine.core.common.action.QosParametersBase in project ovirt-engine by oVirt.
the class EditNetworkQoSModel method executeSave.
@Override
public void executeSave() {
QosParametersBase<NetworkQoS> parameters = new QosParametersBase<>();
parameters.setQos(networkQoS);
Frontend.getInstance().runAction(ActionType.UpdateNetworkQoS, parameters, result -> {
ActionReturnValue retVal = result.getReturnValue();
boolean succeeded = false;
if (retVal != null && retVal.getSucceeded()) {
succeeded = true;
}
postSaveAction(succeeded);
});
}
use of org.ovirt.engine.core.common.action.QosParametersBase in project ovirt-engine by oVirt.
the class RemoveNetworkQoSModel method onRemove.
public void onRemove() {
ArrayList<ActionParametersBase> parameters = new ArrayList<>();
for (Object networkQoS : sourceListModel.getSelectedItems()) {
QosParametersBase<NetworkQoS> parameter = new QosParametersBase<>();
NetworkQoS tempQos = (NetworkQoS) networkQoS;
parameter.setQos(tempQos);
parameters.add(parameter);
}
Frontend.getInstance().runMultipleAction(ActionType.RemoveNetworkQoS, parameters);
cancel();
}
use of org.ovirt.engine.core.common.action.QosParametersBase 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.action.QosParametersBase in project ovirt-engine by oVirt.
the class NewNetworkQoSModel method executeSave.
@Override
protected void executeSave() {
// New network QoS
final QosParametersBase<NetworkQoS> parameters = new QosParametersBase<>();
parameters.setQos(networkQoS);
Frontend.getInstance().runAction(ActionType.AddNetworkQoS, parameters, result -> {
ActionReturnValue retVal = result.getReturnValue();
boolean succeeded = false;
if (retVal != null && retVal.getSucceeded()) {
succeeded = true;
networkQoS.setId((Guid) retVal.getActionReturnValue());
}
postSaveAction(succeeded);
});
}
use of org.ovirt.engine.core.common.action.QosParametersBase 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