Search in sources :

Example 1 with UpdateGlusterVolumeSnapshotConfigParameters

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

the class VolumeListModel method onConfigureVolumeSnapshotOptions.

public void onConfigureVolumeSnapshotOptions() {
    GlusterVolumeSnapshotConfigModel volumeSnapshotConfigModel = (GlusterVolumeSnapshotConfigModel) getWindow();
    GlusterVolumeEntity volumeEntity = volumeSnapshotConfigModel.getSelectedVolumeEntity();
    List<GlusterVolumeSnapshotConfig> vdsParams = new ArrayList<>();
    for (EntityModel<VolumeSnapshotOptionModel> volumeCfg : volumeSnapshotConfigModel.getConfigOptions().getItems()) {
        vdsParams.add(new GlusterVolumeSnapshotConfig(volumeEntity.getClusterId(), volumeEntity.getId(), volumeCfg.getEntity().getOptionName(), volumeCfg.getEntity().getOptionValue()));
    }
    Frontend.getInstance().runAction(ActionType.UpdateGlusterVolumeSnapshotConfig, new UpdateGlusterVolumeSnapshotConfigParameters(volumeEntity.getClusterId(), volumeEntity.getId(), vdsParams), result -> {
        if (result.getReturnValue() != null && result.getReturnValue().getSucceeded()) {
            cancel();
        }
        if (getConfirmWindow() != null) {
            setConfirmWindow(null);
        }
    }, this);
}
Also used : GlusterVolumeSnapshotConfig(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig) GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) GlusterVolumeSnapshotConfigModel(org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotConfigModel) ArrayList(java.util.ArrayList) VolumeSnapshotOptionModel(org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeSnapshotOptionModel) UpdateGlusterVolumeSnapshotConfigParameters(org.ovirt.engine.core.common.action.gluster.UpdateGlusterVolumeSnapshotConfigParameters)

Example 2 with UpdateGlusterVolumeSnapshotConfigParameters

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

the class VolumeListModel method onConfigureClusterSnapshotOptions.

public void onConfigureClusterSnapshotOptions() {
    GlusterClusterSnapshotConfigModel clusterSnapshotConfigModel = (GlusterClusterSnapshotConfigModel) getWindow();
    Guid clusterId = clusterSnapshotConfigModel.getClusters().getSelectedItem().getId();
    List<GlusterVolumeSnapshotConfig> vdsParams = new ArrayList<>();
    for (EntityModel<GlusterVolumeSnapshotConfig> clusterCfg : clusterSnapshotConfigModel.getClusterConfigOptions().getItems()) {
        vdsParams.add(new GlusterVolumeSnapshotConfig(clusterId, null, clusterCfg.getEntity().getParamName(), clusterCfg.getEntity().getParamValue()));
    }
    Frontend.getInstance().runAction(ActionType.UpdateGlusterVolumeSnapshotConfig, new UpdateGlusterVolumeSnapshotConfigParameters(clusterId, null, vdsParams), result -> {
        if (result.getReturnValue() != null && result.getReturnValue().getSucceeded()) {
            cancel();
        }
        if (getConfirmWindow() != null) {
            setConfirmWindow(null);
        }
    }, this);
}
Also used : GlusterClusterSnapshotConfigModel(org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterClusterSnapshotConfigModel) GlusterVolumeSnapshotConfig(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig) ArrayList(java.util.ArrayList) Guid(org.ovirt.engine.core.compat.Guid) UpdateGlusterVolumeSnapshotConfigParameters(org.ovirt.engine.core.common.action.gluster.UpdateGlusterVolumeSnapshotConfigParameters)

Aggregations

ArrayList (java.util.ArrayList)2 UpdateGlusterVolumeSnapshotConfigParameters (org.ovirt.engine.core.common.action.gluster.UpdateGlusterVolumeSnapshotConfigParameters)2 GlusterVolumeSnapshotConfig (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig)2 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)1 Guid (org.ovirt.engine.core.compat.Guid)1 GlusterClusterSnapshotConfigModel (org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterClusterSnapshotConfigModel)1 GlusterVolumeSnapshotConfigModel (org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotConfigModel)1 VolumeSnapshotOptionModel (org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeSnapshotOptionModel)1