From 40139b8532cf0063023ab645980ec076d2c098f6 Mon Sep 17 00:00:00 2001 From: Mpdreamz Date: Wed, 14 Jul 2021 14:05:59 +0000 Subject: [PATCH] [codegen] 7.x synchronization --- .../Core/indices.field_usage_stats.json | 57 +++++++++++++++++++ .../RequestParameters.Indices.cs | 37 ++++++++++++ .../ElasticLowLevelClient.Indices.cs | 13 +++++ 3 files changed, 107 insertions(+) create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.field_usage_stats.json diff --git a/src/ApiGenerator/RestSpecification/Core/indices.field_usage_stats.json b/src/ApiGenerator/RestSpecification/Core/indices.field_usage_stats.json new file mode 100644 index 00000000000..90eb729da20 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.field_usage_stats.json @@ -0,0 +1,57 @@ +{ + "indices.field_usage_stats": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html", + "description": "Returns the field usage stats for each field of an index" + }, + "stability": "experimental", + "visibility": "public", + "headers": { + "accept": [ + "application/json" + ] + }, + "url": { + "paths": [ + { + "path": "/{index}/_field_usage_stats", + "methods": [ + "GET" + ], + "parts": { + "index": { + "type": "string", + "description": "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params": { + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to include in the stats if only a subset of fields should be returned (supports wildcards)" + }, + "ignore_unavailable": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" + }, + "expand_wildcards": { + "type": "enum", + "options": [ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default": "open", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.Indices.cs b/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.Indices.cs index ee07cb7a2b5..d7e7dcf3694 100644 --- a/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.Indices.cs +++ b/src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.Indices.cs @@ -612,6 +612,43 @@ public bool? Local } } + ///Request options for FieldUsageStats https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html + public class FieldUsageStatsRequestParameters : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.GET; + public override bool SupportsBody => false; + /// + /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have + /// been specified) + /// + public bool? AllowNoIndices + { + get => Q("allow_no_indices"); + set => Q("allow_no_indices", value); + } + + ///Whether to expand wildcard expression to concrete indices that are open, closed or both. + public ExpandWildcards? ExpandWildcards + { + get => Q("expand_wildcards"); + set => Q("expand_wildcards", value); + } + + ///A comma-separated list of fields to include in the stats if only a subset of fields should be returned (supports wildcards) + public string[] Fields + { + get => Q("fields"); + set => Q("fields", value); + } + + ///Whether specified concrete indices should be ignored when unavailable (missing or closed) + public bool? IgnoreUnavailable + { + get => Q("ignore_unavailable"); + set => Q("ignore_unavailable", value); + } + } + ///Request options for Flush https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html public class FlushRequestParameters : RequestParameters { diff --git a/src/Elasticsearch.Net/ElasticLowLevelClient.Indices.cs b/src/Elasticsearch.Net/ElasticLowLevelClient.Indices.cs index fb15b7fcc54..13729dbb8f0 100644 --- a/src/Elasticsearch.Net/ElasticLowLevelClient.Indices.cs +++ b/src/Elasticsearch.Net/ElasticLowLevelClient.Indices.cs @@ -313,6 +313,19 @@ public TResponse TypeExists(string index, string type, TypeExistsRequ [MapsApi("indices.exists_type", "index, type")] public Task TypeExistsAsync(string index, string type, TypeExistsRequestParameters requestParameters = null, CancellationToken ctx = default) where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync(HEAD, Url($"{index:index}/_mapping/{type:type}"), ctx, null, RequestParams(requestParameters)); + ///GET on /{index}/_field_usage_stats https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html + ///A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices + ///Request specific configuration such as querystring parameters & request specific connection settings. + ///Note: Experimental within the Elasticsearch server, this functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features. This functionality is subject to potential breaking changes within a minor version, meaning that your referencing code may break when this library is upgraded. + public TResponse FieldUsageStats(string index, FieldUsageStatsRequestParameters requestParameters = null) + where TResponse : class, IElasticsearchResponse, new() => DoRequest(GET, Url($"{index:index}/_field_usage_stats"), null, RequestParams(requestParameters)); + ///GET on /{index}/_field_usage_stats https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html + ///A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices + ///Request specific configuration such as querystring parameters & request specific connection settings. + ///Note: Experimental within the Elasticsearch server, this functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features. This functionality is subject to potential breaking changes within a minor version, meaning that your referencing code may break when this library is upgraded. + [MapsApi("indices.field_usage_stats", "index")] + public Task FieldUsageStatsAsync(string index, FieldUsageStatsRequestParameters requestParameters = null, CancellationToken ctx = default) + where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync(GET, Url($"{index:index}/_field_usage_stats"), ctx, null, RequestParams(requestParameters)); ///POST on /_flush https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html ///Request specific configuration such as querystring parameters & request specific connection settings. public TResponse FlushForAll(FlushRequestParameters requestParameters = null)