use of org.ovirt.engine.core.common.action.RemoveVmParameters 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;
}
use of org.ovirt.engine.core.common.action.RemoveVmParameters in project ovirt-engine by oVirt.
the class VmListModel method onRemove.
private void onRemove() {
final ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
final ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Entry<Guid, EntityModel> entry : vmsRemoveMap.entrySet()) {
list.add(new RemoveVmParameters(entry.getKey(), false, (Boolean) entry.getValue().getEntity()));
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveVm, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
use of org.ovirt.engine.core.common.action.RemoveVmParameters in project ovirt-engine by oVirt.
the class BackendVmResource method remove.
@Override
public Response remove() {
get();
boolean force = ParametersHelper.getBooleanParameter(httpHeaders, uriInfo, FORCE, true, false);
RemoveVmParameters params = new RemoveVmParameters(guid, force);
// If detach only is set we do not remove the VM disks
boolean detachOnly = ParametersHelper.getBooleanParameter(httpHeaders, uriInfo, DETACH_ONLY, true, false);
if (detachOnly) {
params.setRemoveDisks(false);
}
return performAction(ActionType.RemoveVm, params);
}
use of org.ovirt.engine.core.common.action.RemoveVmParameters in project ovirt-engine by oVirt.
the class UpdateVmVersionCommand method buildRemoveVmParameters.
private RemoveVmParameters buildRemoveVmParameters() {
RemoveVmParameters parameters = new RemoveVmParameters(getVmId(), false);
parameters.setParentCommand(getActionType());
parameters.setParentParameters(getParameters());
parameters.setEntityInfo(getParameters().getEntityInfo());
parameters.setRemovePermissions(false);
return parameters;
}
use of org.ovirt.engine.core.common.action.RemoveVmParameters in project ovirt-engine by oVirt.
the class HostedEngineImporter method removedHEVM.
private boolean removedHEVM(VM vm) {
RemoveVmParameters parameters = new RemoveVmParameters(vm.getId(), true);
parameters.setRemoveDisks(false);
return backend.runInternalAction(ActionType.RemoveVm, parameters).getSucceeded();
}
Aggregations