Search in sources :

Example 1 with GlusterVolumeRebalanceParameters

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

the class VolumeListModel method onStopRebalance.

private void onStopRebalance() {
    ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
    if (model.getProgress() != null) {
        return;
    }
    if (getSelectedItems() == null) {
        return;
    }
    model.startProgress();
    final GlusterVolumeEntity volumeEntity = getSelectedItem();
    GlusterVolumeRebalanceParameters param = new GlusterVolumeRebalanceParameters(volumeEntity.getId(), false, false);
    Frontend.getInstance().runAction(ActionType.StopRebalanceGlusterVolume, param, result -> {
        ConfirmationModel localModel = (ConfirmationModel) getConfirmWindow();
        localModel.stopProgress();
        setConfirmWindow(null);
        if (result.getReturnValue().getSucceeded()) {
            showRebalanceStatus();
        }
    });
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) GlusterVolumeRebalanceParameters(org.ovirt.engine.core.common.action.gluster.GlusterVolumeRebalanceParameters)

Example 2 with GlusterVolumeRebalanceParameters

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

the class VolumeListModel method startRebalance.

private void startRebalance() {
    if (getSelectedItems() == null) {
        return;
    }
    ArrayList<ActionParametersBase> list = new ArrayList<>();
    for (Object item : getSelectedItems()) {
        GlusterVolumeEntity volume = (GlusterVolumeEntity) item;
        list.add(new GlusterVolumeRebalanceParameters(volume.getId(), false, false));
    }
    Frontend.getInstance().runMultipleAction(ActionType.StartRebalanceGlusterVolume, list, null, true, true);
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) ArrayList(java.util.ArrayList) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) GlusterVolumeRebalanceParameters(org.ovirt.engine.core.common.action.gluster.GlusterVolumeRebalanceParameters)

Example 3 with GlusterVolumeRebalanceParameters

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

the class BackendGlusterVolumeResource method rebalance.

@Override
public Response rebalance(Action action) {
    boolean fixLayoutOnly = action.isSetFixLayout() ? action.isFixLayout() : false;
    boolean force = action.isSetForce() ? action.isForce() : false;
    return doAction(ActionType.StartRebalanceGlusterVolume, new GlusterVolumeRebalanceParameters(guid, fixLayoutOnly, force), action);
}
Also used : GlusterVolumeRebalanceParameters(org.ovirt.engine.core.common.action.gluster.GlusterVolumeRebalanceParameters)

Aggregations

GlusterVolumeRebalanceParameters (org.ovirt.engine.core.common.action.gluster.GlusterVolumeRebalanceParameters)3 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)2 ArrayList (java.util.ArrayList)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)1