use of org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters in project ovirt-engine by oVirt.
the class RemoveDiskModel method onRemove.
public void onRemove(final ICommandTarget target) {
boolean removeDisk = getLatch().getEntity();
ActionType actionType = removeDisk ? ActionType.RemoveDisk : ActionType.DetachDiskFromVm;
List<ActionParametersBase> parameterList = disksToRemove.stream().map(disk -> removeDisk ? new RemoveDiskParameters(disk.getId()) : new AttachDetachVmDiskParameters(new DiskVmElement(disk.getId(), vm.getId()))).collect(Collectors.toList());
startProgress();
Frontend.getInstance().runMultipleAction(actionType, parameterList, result -> {
stopProgress();
target.executeCommand(cancelCommand);
}, this);
}
Aggregations