public async Task <IActionResult> CreateReindexJob([FromBody] Parameters inputParams) { CheckIfReindexIsEnabledAndRespond(); ValidateParams(inputParams); ushort?maximumConcurrency = (ushort?)ReadNumericParameter(inputParams, JobRecordProperties.MaximumConcurrency); uint? maxResourcesPerQuery = (uint?)ReadNumericParameter(inputParams, JobRecordProperties.MaximumNumberOfResourcesPerQuery); int? queryDelay = ReadNumericParameter(inputParams, JobRecordProperties.QueryDelayIntervalInMilliseconds); ushort?targetDataStoreResourcePercentage = (ushort?)ReadNumericParameter(inputParams, JobRecordProperties.TargetDataStoreUsagePercentage); ResourceElement response = await _mediator.CreateReindexJobAsync( maximumConcurrency, maxResourcesPerQuery, queryDelay, targetDataStoreResourcePercentage, HttpContext.RequestAborted); var result = FhirResult.Create(response, HttpStatusCode.Created) .SetETagHeader() .SetLastModifiedHeader(); result.SetContentLocationHeader(_urlResolver, OperationsConstants.Reindex, response.Id); return(result); }
public async Task <IActionResult> CreateReindexJob([FromBody] Parameters inputParams) { CheckIfReindexIsEnabledAndRespond(); ValidateParams(inputParams); ushort?maximumConcurrency = ReadNumericParameter(inputParams, JobRecordProperties.MaximumConcurrency); string scope = ReadStringParameter(inputParams, JobRecordProperties.Scope); ResourceElement response = await _mediator.CreateReindexJobAsync(maximumConcurrency, scope, HttpContext.RequestAborted); return(FhirResult.Create(response, HttpStatusCode.Created) .SetETagHeader() .SetLastModifiedHeader()); }
public async Task <IActionResult> CreateReindexJob([FromBody] Parameters inputParams) { CheckIfReindexIsEnabledAndRespond(); ValidateParams(inputParams); ushort?maximumConcurrency = ReadNumericParameter(inputParams, JobRecordProperties.MaximumConcurrency); ResourceElement response = await _mediator.CreateReindexJobAsync(maximumConcurrency, HttpContext.RequestAborted); var result = FhirResult.Create(response, HttpStatusCode.Created) .SetETagHeader() .SetLastModifiedHeader(); result.SetContentLocationHeader(_urlResolver, OperationsConstants.Reindex, response.Id); return(result); }