[Route("inputdata/refreshsample")] // schema inf public async Task <ApiResult> RefreshSample([FromBody] JObject jObject) { try { RolesCheck.EnsureWriter(Request); SchemaInferenceManager sim = new SchemaInferenceManager(_logger); return(await sim.RefreshSample(jObject)); } catch (Exception e) { _logger.LogError(e, e.Message); return(ApiResult.CreateError(e.Message)); } }
public async Task <ApiResult> RefreshInputDataAndKernel(JObject jObject) { var diag = jObject.ToObject <InteractiveQueryObject>(); var response = await _engineEnvironment.GetEnvironmentVariables(); if (response.Error.HasValue && response.Error.Value) { _logger.LogError(response.Message); return(ApiResult.CreateError(response.Message)); } //Refresh the sample data SchemaInferenceManager sim = new SchemaInferenceManager(_logger); response = await sim.RefreshSample(jObject); if (response.Error.HasValue && response.Error.Value) { _logger.LogError(response.Message); return(ApiResult.CreateError(response.Message)); } InteractiveQueryManager iqm = new InteractiveQueryManager(_logger); response = await iqm.RecycleKernelHelper(diag, true); if (response.Error.HasValue && response.Error.Value) { _logger.LogError(response.Message); return(ApiResult.CreateError(response.Message)); } var result = response.Result; _logger.LogInformation("RefreshInputDataAndKernel successful!"); return(ApiResult.CreateSuccess(result)); }