use of org.ovirt.engine.core.common.action.VmOperationParameterBase in project ovirt-engine by oVirt.
the class DetachUserFromVmFromPoolCommand method restoreVmFromBaseSnapshot.
private void restoreVmFromBaseSnapshot(VM vm) {
if (snapshotDao.exists(vm.getId(), SnapshotType.STATELESS)) {
log.info("Deleting snapshots for stateless vm '{}'", vm.getId());
VmOperationParameterBase restoreParams = new VmOperationParameterBase(vm.getId());
// setting RestoreStatelessVm to run in new transaction so it could rollback internally if needed,
// but still not affect this command, in order to keep permissions changes even on restore failure
restoreParams.setTransactionScopeOption(TransactionScopeOption.RequiresNew);
runInternalAction(ActionType.RestoreStatelessVm, restoreParams, getContext().withCompensationContext(null));
}
}
use of org.ovirt.engine.core.common.action.VmOperationParameterBase in project ovirt-engine by oVirt.
the class BackendVmResource method reorderMacAddresses.
@Override
public Response reorderMacAddresses(Action action) {
getEntity(org.ovirt.engine.core.common.businessentities.VM.class, QueryType.GetVmByVmId, new IdQueryParameters(guid), "VM: id=" + guid, true);
final VmOperationParameterBase params = new VmOperationParameterBase(guid);
final Response response = doAction(ActionType.ReorderVmNics, params, action);
return response;
}
use of org.ovirt.engine.core.common.action.VmOperationParameterBase in project ovirt-engine by oVirt.
the class VmInterfaceCreatingManager method doNicManipulation.
@Override
protected void doNicManipulation(final ArrayList<ActionParametersBase> createVnicParameters, final ArrayList<ActionParametersBase> updateVnicParameters, final ArrayList<ActionParametersBase> removeVnicParameters, final boolean isAddingNewVm, final Guid id, final UnitVmModel unitVmModel) {
Frontend.getInstance().runMultipleActions(ActionType.AddVmInterface, createVnicParameters, addInterfaceResult -> Frontend.getInstance().runMultipleActions(ActionType.UpdateVmInterface, updateVnicParameters, updateInterfaceResult -> Frontend.getInstance().runMultipleActions(ActionType.RemoveVmInterface, removeVnicParameters, removeInterfaceResult -> {
if (isAddingNewVm) {
VmOperationParameterBase reorderParams = new VmOperationParameterBase(id);
Frontend.getInstance().runAction(ActionType.ReorderVmNics, reorderParams, reorderResult -> getCallback().vnicCreated(id, unitVmModel));
} else {
getCallback().vnicCreated(id, unitVmModel);
}
}, this), this), this);
}
Aggregations