Skip to content

Commit e0dc1fd

Browse files
[codegen] 7.x synchronization (#5884)
Co-authored-by: Mpdreamz <Mpdreamz@users.noreply.github.com>
1 parent f6de405 commit e0dc1fd

File tree

3 files changed

+107
-0
lines changed

3 files changed

+107
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"indices.field_usage_stats": {
3+
"documentation": {
4+
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html",
5+
"description": "Returns the field usage stats for each field of an index"
6+
},
7+
"stability": "experimental",
8+
"visibility": "public",
9+
"headers": {
10+
"accept": [
11+
"application/json"
12+
]
13+
},
14+
"url": {
15+
"paths": [
16+
{
17+
"path": "/{index}/_field_usage_stats",
18+
"methods": [
19+
"GET"
20+
],
21+
"parts": {
22+
"index": {
23+
"type": "string",
24+
"description": "A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices"
25+
}
26+
}
27+
}
28+
]
29+
},
30+
"params": {
31+
"fields":{
32+
"type":"list",
33+
"description":"A comma-separated list of fields to include in the stats if only a subset of fields should be returned (supports wildcards)"
34+
},
35+
"ignore_unavailable": {
36+
"type": "boolean",
37+
"description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)"
38+
},
39+
"allow_no_indices": {
40+
"type": "boolean",
41+
"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)"
42+
},
43+
"expand_wildcards": {
44+
"type": "enum",
45+
"options": [
46+
"open",
47+
"closed",
48+
"hidden",
49+
"none",
50+
"all"
51+
],
52+
"default": "open",
53+
"description": "Whether to expand wildcard expression to concrete indices that are open, closed or both."
54+
}
55+
}
56+
}
57+
}

src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.Indices.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,43 @@ public bool? Local
612612
}
613613
}
614614

615+
///<summary>Request options for FieldUsageStats <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html</para></summary>
616+
public class FieldUsageStatsRequestParameters : RequestParameters<FieldUsageStatsRequestParameters>
617+
{
618+
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
619+
public override bool SupportsBody => false;
620+
///<summary>
621+
/// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have
622+
/// been specified)
623+
///</summary>
624+
public bool? AllowNoIndices
625+
{
626+
get => Q<bool? >("allow_no_indices");
627+
set => Q("allow_no_indices", value);
628+
}
629+
630+
///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
631+
public ExpandWildcards? ExpandWildcards
632+
{
633+
get => Q<ExpandWildcards? >("expand_wildcards");
634+
set => Q("expand_wildcards", value);
635+
}
636+
637+
///<summary>A comma-separated list of fields to include in the stats if only a subset of fields should be returned (supports wildcards)</summary>
638+
public string[] Fields
639+
{
640+
get => Q<string[]>("fields");
641+
set => Q("fields", value);
642+
}
643+
644+
///<summary>Whether specified concrete indices should be ignored when unavailable (missing or closed)</summary>
645+
public bool? IgnoreUnavailable
646+
{
647+
get => Q<bool? >("ignore_unavailable");
648+
set => Q("ignore_unavailable", value);
649+
}
650+
}
651+
615652
///<summary>Request options for Flush <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html</para></summary>
616653
public class FlushRequestParameters : RequestParameters<FlushRequestParameters>
617654
{

src/Elasticsearch.Net/ElasticLowLevelClient.Indices.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,19 @@ public TResponse TypeExists<TResponse>(string index, string type, TypeExistsRequ
313313
[MapsApi("indices.exists_type", "index, type")]
314314
public Task<TResponse> TypeExistsAsync<TResponse>(string index, string type, TypeExistsRequestParameters requestParameters = null, CancellationToken ctx = default)
315315
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(HEAD, Url($"{index:index}/_mapping/{type:type}"), ctx, null, RequestParams(requestParameters));
316+
///<summary>GET on /{index}/_field_usage_stats <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html</para></summary>
317+
///<param name = "index">A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices</param>
318+
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
319+
///<remarks>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.</remarks>
320+
public TResponse FieldUsageStats<TResponse>(string index, FieldUsageStatsRequestParameters requestParameters = null)
321+
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, Url($"{index:index}/_field_usage_stats"), null, RequestParams(requestParameters));
322+
///<summary>GET on /{index}/_field_usage_stats <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html</para></summary>
323+
///<param name = "index">A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices</param>
324+
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
325+
///<remarks>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.</remarks>
326+
[MapsApi("indices.field_usage_stats", "index")]
327+
public Task<TResponse> FieldUsageStatsAsync<TResponse>(string index, FieldUsageStatsRequestParameters requestParameters = null, CancellationToken ctx = default)
328+
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"{index:index}/_field_usage_stats"), ctx, null, RequestParams(requestParameters));
316329
///<summary>POST on /_flush <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html</para></summary>
317330
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
318331
public TResponse FlushForAll<TResponse>(FlushRequestParameters requestParameters = null)

0 commit comments

Comments
 (0)