public async Task <IActionResult> GetDetailHistory([FromRoute] long id, [FromRoute] long?dataId, [FromServices] IClusterManagementLogic clusterManagementLogic)
        {
            if (dataId == null)
            {
                return(JsonBadRequest("Data ID is required."));
            }

            var history = await preprocessHistoryRepository.GetPreprocessIncludeDataAndPreprocessAsync(id, dataId.Value);

            if (history == null)
            {
                return(JsonNotFound($"Preprocessing History about Preprocess {id} to Data {dataId} is not found."));
            }

            var result = new HistoryDetailsOutputModel(history);

            result = await GetUpdatedIndexOutputModelAsync(history, result, clusterManagementLogic) as HistoryDetailsOutputModel;

            result.OutputDataIds = preprocessHistoryRepository.GetPreprocessOutputs(history.Id);
            return(JsonOK(result));
        }
        public async Task <IActionResult> DeleteHistory([FromRoute] long id, [FromRoute] long?dataId,
                                                        [FromServices] IPreprocessHistoryRepository preprocessHistoryRepository,
                                                        [FromServices] IPreprocessLogic preprocessLogic)
        {
            if (dataId == null)
            {
                return(JsonBadRequest("Data ID is requried."));
            }

            //データの存在チェック
            var preprocessHistory = await preprocessHistoryRepository.GetPreprocessIncludeDataAndPreprocessAsync(id, dataId.Value);

            if (preprocessHistory == null)
            {
                return(JsonNotFound($"Preprocessing History about Preprocess {id} to Data {dataId} is not found."));
            }

            //出力データを削除できるか、確認
            var lockedOutput = preprocessHistoryRepository.GetLockedOutput(preprocessHistory.Id);

            if (lockedOutput != null)
            {
                return(JsonConflict($"Preprocessing History about Preprocess {id} to Data {dataId} can NOT delete. The output data {lockedOutput.Id} is locked."));
            }

            //前処理履歴の削除
            bool result = await preprocessLogic.DeleteAsync(preprocessHistory, false);

            if (result)
            {
                return(JsonNoContent());
            }
            else
            {
                return(JsonError(HttpStatusCode.ServiceUnavailable, $"Failed to delete Preprocessing History about Preprocess {id} to Data {dataId}. Please contact your server administrator."));
            }
        }