public static Task ResumeIngestAsync(this ISearchIndexManager manager, string indexName, Action <ResumeIngestSearchIndexOptions> configureOptions) { var options = new ResumeIngestSearchIndexOptions(); configureOptions(options); return(manager.ResumeIngestAsync(indexName, options)); }
public async Task ResumeIngestAsync(string indexName, ResumeIngestSearchIndexOptions options) { var baseUri = GetIngestControlUri(indexName, false); Logger.LogInformation($"Trying to resume ingest for index with name {indexName} - {baseUri}"); try { var result = await _client.PostAsync(baseUri, null, options.CancellationToken).ConfigureAwait(false); if (result.StatusCode == HttpStatusCode.NotFound) { throw new SearchIndexNotFound(indexName); } result.EnsureSuccessStatusCode(); } catch (Exception exception) { Logger.LogError(exception, $"Failed to resume ingest for index with name {indexName} - {baseUri}"); throw; } }