Search in sources :

Example 1 with ShutdownVmParameters

use of org.ovirt.engine.core.common.action.ShutdownVmParameters in project ovirt-engine by oVirt.

the class RebootVmCommand method perform.

@Override
protected void perform() {
    if (isColdReboot()) {
        ActionReturnValue returnValue = runInternalAction(ActionType.ShutdownVm, new ShutdownVmParameters(getVmId(), false));
        setReturnValue(returnValue);
        setSucceeded(returnValue.getSucceeded());
        if (getSucceeded()) {
            resourceManager.getVmManager(getVmId()).setColdReboot(true);
        }
    } else {
        final VDSReturnValue returnValue = runVdsCommand(VDSCommandType.RebootVm, new VdsAndVmIDVDSParametersBase(getVdsId(), getVmId()));
        setActionReturnValue(returnValue.getReturnValue());
        setSucceeded(returnValue.getSucceeded());
    }
}
Also used : VdsAndVmIDVDSParametersBase(org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) ShutdownVmParameters(org.ovirt.engine.core.common.action.ShutdownVmParameters) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 2 with ShutdownVmParameters

use of org.ovirt.engine.core.common.action.ShutdownVmParameters in project ovirt-engine by oVirt.

the class VmListModel method onShutdown.

private void onShutdown() {
    final ConfirmationModel model = (ConfirmationModel) getWindow();
    onPowerAction(ActionType.ShutdownVm, vm -> new ShutdownVmParameters(vm.getId(), true, model.getReason().getEntity()));
}
Also used : ShutdownVmParameters(org.ovirt.engine.core.common.action.ShutdownVmParameters) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Aggregations

ShutdownVmParameters (org.ovirt.engine.core.common.action.ShutdownVmParameters)2 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)1 VdsAndVmIDVDSParametersBase (org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase)1 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)1