use of org.ovirt.engine.core.common.action.RemoveVmFromPoolParameters in project ovirt-engine by oVirt.
the class PoolVmListModel method onDetach.
public void onDetach() {
ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
boolean latchChecked = !model.validate();
if (model.getProgress() != null || latchChecked) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object item : getSelectedItems()) {
VM vm = (VM) item;
list.add(new RemoveVmFromPoolParameters(vm.getId(), true, true));
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveVmFromPool, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
use of org.ovirt.engine.core.common.action.RemoveVmFromPoolParameters in project ovirt-engine by oVirt.
the class UpdateVmVersionCommand method buildRemoveVmFromPoolParameters.
private RemoveVmFromPoolParameters buildRemoveVmFromPoolParameters() {
RemoveVmFromPoolParameters parameters = new RemoveVmFromPoolParameters(getVmId(), false, false);
parameters.setTransactionScopeOption(TransactionScopeOption.RequiresNew);
return parameters;
}
use of org.ovirt.engine.core.common.action.RemoveVmFromPoolParameters in project ovirt-engine by oVirt.
the class RemoveVmPoolCommand method removeVm.
private boolean removeVm(VM vm) {
RemoveVmFromPoolParameters removeVmFromPoolParameters = new RemoveVmFromPoolParameters(vm.getId(), false, false);
removeVmFromPoolParameters.setTransactionScopeOption(TransactionScopeOption.Suppress);
ActionReturnValue result = runInternalActionWithTasksContext(ActionType.RemoveVmFromPool, removeVmFromPoolParameters);
if (!result.getSucceeded()) {
return false;
}
result = runInternalAction(ActionType.RemoveVm, new RemoveVmParameters(vm.getId(), false), createRemoveVmStepContext(vm));
if (!result.getSucceeded()) {
return false;
}
vmsRemoved.add(vm.getId());
return true;
}
Aggregations