Search in sources :

Example 1 with RemoveDiskSnapshotsParameters

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

the class StorageSnapshotListModel method onRemove.

private void onRemove() {
    ConfirmationModel model = (ConfirmationModel) getWindow();
    ArrayList<ActionParametersBase> paramerterList = new ArrayList<>();
    Map<Guid, List<Guid>> diskImageIdsMap = groupImageIdsByDiskId(getSelectedItems());
    for (List<Guid> imageIds : diskImageIdsMap.values()) {
        RemoveDiskSnapshotsParameters parameters = new RemoveDiskSnapshotsParameters(new ArrayList<>(imageIds));
        paramerterList.add(parameters);
    }
    model.startProgress();
    Frontend.getInstance().runMultipleAction(ActionType.RemoveDiskSnapshots, paramerterList, result -> {
        StorageSnapshotListModel localModel = (StorageSnapshotListModel) result.getState();
        localModel.stopProgress();
        cancel();
    }, this);
}
Also used : RemoveDiskSnapshotsParameters(org.ovirt.engine.core.common.action.RemoveDiskSnapshotsParameters) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) Guid(org.ovirt.engine.core.compat.Guid) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 2 with RemoveDiskSnapshotsParameters

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

the class RemoveDiskSnapshotsCommandTest method createCommand.

private static RemoveDiskSnapshotsCommand<RemoveDiskSnapshotsParameters> createCommand() {
    RemoveDiskSnapshotsParameters params = new RemoveDiskSnapshotsParameters(new ArrayList<>(Arrays.asList(IMAGE_ID_1, IMAGE_ID_2)));
    Guid vmGuid = Guid.newGuid();
    params.setContainerId(vmGuid);
    return new RemoveDiskSnapshotsCommand<>(params, null);
}
Also used : RemoveDiskSnapshotsParameters(org.ovirt.engine.core.common.action.RemoveDiskSnapshotsParameters) Guid(org.ovirt.engine.core.compat.Guid)

Aggregations

RemoveDiskSnapshotsParameters (org.ovirt.engine.core.common.action.RemoveDiskSnapshotsParameters)2 Guid (org.ovirt.engine.core.compat.Guid)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)1