use of org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters in project ovirt-engine by oVirt.
the class AffinityGroupListModel method onRemove.
private void onRemove() {
ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> parameters = new ArrayList<>();
for (AffinityGroup affinityGroup : getSelectedItems()) {
parameters.add(new AffinityGroupCRUDParameters(affinityGroup.getId(), affinityGroup));
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveAffinityGroup, parameters, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
use of org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters in project ovirt-engine by oVirt.
the class AffinityGroupModel method onSave.
void onSave() {
if (!validate()) {
return;
}
if (getProgress() != null) {
return;
}
AffinityGroup group = getAffinityGroup();
group.setName(getName().getEntity());
group.setDescription(getDescription().getEntity());
group.setClusterId(clusterId);
// Save VM details
group.setVmEnforcing(getVmAffinityEnforcing().getEntity());
group.setVmAffinityRule(getVmAffinityRule().getSelectedItem());
group.setVmIds(getVmsSelectionModel().getSelectedVmIds());
// Save host details
group.setVdsEnforcing(getHostAffinityEnforcing().getEntity());
group.setVdsAffinityRule(getHostAffinityRule().getSelectedItem());
group.setVdsIds(getHostsSelectionModel().getSelectedHostIds());
startProgress();
Frontend.getInstance().runAction(saveActionType, new AffinityGroupCRUDParameters(group.getId(), group), result -> {
stopProgress();
if (result != null && result.getReturnValue() != null && result.getReturnValue().getSucceeded()) {
cancel();
}
}, this);
}
use of org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters in project ovirt-engine by oVirt.
the class BackendAffinityGroupResource method remove.
@Override
public Response remove() {
get();
AffinityGroupCRUDParameters params = new AffinityGroupCRUDParameters();
params.setAffinityGroupId(asGuid(id));
return performAction(ActionType.RemoveAffinityGroup, params);
}
use of org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters in project ovirt-engine by oVirt.
the class BackendAffinityGroupVmsResource method add.
@Override
public Response add(Vm vm) {
AffinityGroup affinityGroup = getEntity();
affinityGroup.getVmIds().add(asGuid(vm.getId()));
return performAction(ActionType.EditAffinityGroup, new AffinityGroupCRUDParameters(affinityGroup.getId(), affinityGroup));
}
use of org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters in project ovirt-engine by oVirt.
the class BackendAffinityGroupsResource method add.
@Override
public Response add(AffinityGroup affinityGroup) {
org.ovirt.engine.core.common.scheduling.AffinityGroup backendEntity = getMapper(AffinityGroup.class, org.ovirt.engine.core.common.scheduling.AffinityGroup.class).map(affinityGroup, null);
backendEntity.setClusterId(asGuid(clusterId));
return performCreate(ActionType.AddAffinityGroup, new AffinityGroupCRUDParameters(null, backendEntity), new QueryIdResolver<Guid>(QueryType.GetAffinityGroupById, IdQueryParameters.class), true);
}
Aggregations