use of org.ovirt.engine.core.common.action.VmOperationParameterBase in project ovirt-engine by oVirt.
the class VmListModel method cancelMigration.
private void cancelMigration() {
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object item : getSelectedItems()) {
VM a = (VM) item;
list.add(new VmOperationParameterBase(a.getId()));
}
Frontend.getInstance().runMultipleAction(ActionType.CancelMigrateVm, list, result -> {
}, null);
}
use of org.ovirt.engine.core.common.action.VmOperationParameterBase in project ovirt-engine by oVirt.
the class VmListModel method cancelConversion.
private void cancelConversion() {
List<ActionParametersBase> parameters = new ArrayList<>();
for (VM vm : getSelectedItems()) {
parameters.add(new VmOperationParameterBase(vm.getId()));
}
Frontend.getInstance().runMultipleAction(ActionType.CancelConvertVm, parameters);
}
use of org.ovirt.engine.core.common.action.VmOperationParameterBase in project ovirt-engine by oVirt.
the class VmListModel method pause.
private void pause() {
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object item : getSelectedItems()) {
VM a = (VM) item;
list.add(new VmOperationParameterBase(a.getId()));
}
Frontend.getInstance().runMultipleAction(ActionType.HibernateVm, list, result -> {
}, null);
}
use of org.ovirt.engine.core.common.action.VmOperationParameterBase in project ovirt-engine by oVirt.
the class SpiceConsoleModel method invokeConsole.
public void invokeConsole() {
// we attempt to perform SSO (otherwise an error will be thrown)
if (!getConfigurator().getIsAdmin() && getEntity().getStatus() == VMStatus.Up && SsoMethod.GUEST_AGENT.equals(getEntity().getSsoMethod())) {
getLogger().info(// $NON-NLS-1$
"SpiceConsoleManager::Connect: Attempting to perform SSO on Desktop " + getEntity().getName());
Frontend.getInstance().runAction(ActionType.VmLogon, new VmOperationParameterBase(getEntity().getId()), result -> {
final ActionReturnValue logonCommandReturnValue = result.getReturnValue();
boolean isLogonSucceeded = logonCommandReturnValue != null && logonCommandReturnValue.getSucceeded();
if (isLogonSucceeded) {
invokeClient();
} else {
if (logonCommandReturnValue != null && logonCommandReturnValue.getFault().getError() == EngineError.nonresp) {
UICommand okCommand = new UICommand("SpiceWithoutAgentOK", new // $NON-NLS-1$
BaseCommandTarget() {
@Override
public void executeCommand(UICommand uiCommand) {
logSsoOnDesktopFailedAgentNonResp(getLogger(), logonCommandReturnValue != null ? logonCommandReturnValue.getDescription() : // $NON-NLS-1$
"");
invokeClient();
getParentModel().setWindow(null);
}
});
UICommand cancelCommand = new UICommand("SpiceWithoutAgentCancel", new // $NON-NLS-1$
BaseCommandTarget() {
@Override
public void executeCommand(UICommand uiCommand) {
getParentModel().setWindow(null);
}
});
createConnectWithoutAgentConfirmationPopup(okCommand, cancelCommand);
} else {
logSsoOnDesktopFailed(getLogger(), logonCommandReturnValue != null ? logonCommandReturnValue.getDescription() : // $NON-NLS-1$
"");
}
}
}, this);
} else {
invokeClient();
}
}
use of org.ovirt.engine.core.common.action.VmOperationParameterBase in project ovirt-engine by oVirt.
the class ProcessDownVmCommand method removeVmStatelessImages.
private void removeVmStatelessImages() {
if (snapshotDao.exists(getVmId(), SnapshotType.STATELESS) && getVmPoolType() != VmPoolType.MANUAL) {
log.info("Deleting snapshot for stateless vm '{}'", getVmId());
runInternalAction(ActionType.RestoreStatelessVm, new VmOperationParameterBase(getVmId()), ExecutionHandler.createDefaultContextForTasks(getContext(), getLock()));
}
}
Aggregations