Skip to content

Commit 0610f8e

Browse files
[codegen] master synchronization (#6037)
Co-authored-by: Mpdreamz <Mpdreamz@users.noreply.github.com>
1 parent b64a2e9 commit 0610f8e

12 files changed

+74
-147
lines changed

src/ApiGenerator/RestSpecification/Core/fleet.msearch.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
"url":{
1414
"paths":[
1515
{
16-
"path":"/_fleet/_msearch",
16+
"path":"/_fleet/_fleet_msearch",
1717
"methods":[
1818
"GET",
1919
"POST"
2020
]
2121
},
2222
{
23-
"path":"/{index}/_fleet/_msearch",
23+
"path":"/{index}/_fleet/_fleet_msearch",
2424
"methods":[
2525
"GET",
2626
"POST"

src/ApiGenerator/RestSpecification/Core/fleet.search.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"url":{
1414
"paths":[
1515
{
16-
"path":"/{index}/_fleet/_search",
16+
"path":"/{index}/_fleet/_fleet_search",
1717
"methods":[
1818
"GET",
1919
"POST"

src/ApiGenerator/RestSpecification/Core/indices.freeze.json

-67
This file was deleted.

src/ApiGenerator/RestSpecification/Core/ml.delete_trained_model.json

+8
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
}
2525
}
2626
]
27+
},
28+
"params":{
29+
"timeout":{
30+
"type":"time",
31+
"required":false,
32+
"description":"Controls the amount of time to wait for the model to be deleted.",
33+
"default": "30s"
34+
}
2735
}
2836
}
2937
}

src/ApiGenerator/RestSpecification/Core/nodes.hot_threads.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,19 @@
5353
"options":[
5454
"cpu",
5555
"wait",
56-
"block"
56+
"block",
57+
"mem"
5758
],
5859
"description":"The type to sample (default: cpu)"
5960
},
61+
"sort":{
62+
"type":"enum",
63+
"options":[
64+
"cpu",
65+
"total"
66+
],
67+
"description":"The sort order for 'cpu' type (default: total)"
68+
},
6069
"timeout":{
6170
"type":"time",
6271
"description":"Explicit operation timeout"

src/Elasticsearch.Net/Api/Enums.Generated.cs

+28-1
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,15 @@ public enum WaitFor
413413
FullyAllocated
414414
}
415415

416+
[StringEnum]
417+
public enum Sort
418+
{
419+
[EnumMember(Value = "cpu")]
420+
Cpu,
421+
[EnumMember(Value = "total")]
422+
Total
423+
}
424+
416425
[StringEnum]
417426
public enum ThreadType
418427
{
@@ -421,7 +430,9 @@ public enum ThreadType
421430
[EnumMember(Value = "wait")]
422431
Wait,
423432
[EnumMember(Value = "block")]
424-
Block
433+
Block,
434+
[EnumMember(Value = "mem")]
435+
Mem
425436
}
426437

427438
[StringEnum]
@@ -487,6 +498,7 @@ static KnownEnums()
487498
EnumStringResolvers.TryAdd(typeof(OpType), (e) => GetStringValue((OpType)e));
488499
EnumStringResolvers.TryAdd(typeof(IndicesShardStoresStatus), (e) => GetStringValue((IndicesShardStoresStatus)e));
489500
EnumStringResolvers.TryAdd(typeof(WaitFor), (e) => GetStringValue((WaitFor)e));
501+
EnumStringResolvers.TryAdd(typeof(Sort), (e) => GetStringValue((Sort)e));
490502
EnumStringResolvers.TryAdd(typeof(ThreadType), (e) => GetStringValue((ThreadType)e));
491503
EnumStringResolvers.TryAdd(typeof(GridType), (e) => GetStringValue((GridType)e));
492504
EnumStringResolvers.TryAdd(typeof(GroupBy), (e) => GetStringValue((GroupBy)e));
@@ -946,6 +958,19 @@ public static string GetStringValue(this WaitFor enumValue)
946958
throw new ArgumentException($"'{enumValue.ToString()}' is not a valid value for enum 'WaitFor'");
947959
}
948960

961+
public static string GetStringValue(this Sort enumValue)
962+
{
963+
switch (enumValue)
964+
{
965+
case Sort.Cpu:
966+
return "cpu";
967+
case Sort.Total:
968+
return "total";
969+
}
970+
971+
throw new ArgumentException($"'{enumValue.ToString()}' is not a valid value for enum 'Sort'");
972+
}
973+
949974
public static string GetStringValue(this ThreadType enumValue)
950975
{
951976
switch (enumValue)
@@ -956,6 +981,8 @@ public static string GetStringValue(this ThreadType enumValue)
956981
return "wait";
957982
case ThreadType.Block:
958983
return "block";
984+
case ThreadType.Mem:
985+
return "mem";
959986
}
960987

961988
throw new ArgumentException($"'{enumValue.ToString()}' is not a valid value for enum 'ThreadType'");

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

-49
Original file line numberDiff line numberDiff line change
@@ -662,55 +662,6 @@ public bool? OnlyExpungeDeletes
662662
}
663663
}
664664

665-
///<summary>Request options for Freeze <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html</para></summary>
666-
public class FreezeIndexRequestParameters : RequestParameters<FreezeIndexRequestParameters>
667-
{
668-
///<summary>
669-
/// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have
670-
/// been specified)
671-
///</summary>
672-
public bool? AllowNoIndices
673-
{
674-
get => Q<bool? >("allow_no_indices");
675-
set => Q("allow_no_indices", value);
676-
}
677-
678-
///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
679-
public ExpandWildcards? ExpandWildcards
680-
{
681-
get => Q<ExpandWildcards? >("expand_wildcards");
682-
set => Q("expand_wildcards", value);
683-
}
684-
685-
///<summary>Whether specified concrete indices should be ignored when unavailable (missing or closed)</summary>
686-
public bool? IgnoreUnavailable
687-
{
688-
get => Q<bool? >("ignore_unavailable");
689-
set => Q("ignore_unavailable", value);
690-
}
691-
692-
///<summary>Specify timeout for connection to master</summary>
693-
public TimeSpan MasterTimeout
694-
{
695-
get => Q<TimeSpan>("master_timeout");
696-
set => Q("master_timeout", value);
697-
}
698-
699-
///<summary>Explicit operation timeout</summary>
700-
public TimeSpan Timeout
701-
{
702-
get => Q<TimeSpan>("timeout");
703-
set => Q("timeout", value);
704-
}
705-
706-
///<summary>Sets the number of active shards to wait for before the operation returns.</summary>
707-
public string WaitForActiveShards
708-
{
709-
get => Q<string>("wait_for_active_shards");
710-
set => Q("wait_for_active_shards", value);
711-
}
712-
}
713-
714665
///<summary>Request options for Get <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html</para></summary>
715666
public class GetIndexRequestParameters : RequestParameters<GetIndexRequestParameters>
716667
{

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

+6
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ public class DeleteModelSnapshotRequestParameters : RequestParameters<DeleteMode
172172
///<summary>Request options for DeleteTrainedModel <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models.html</para></summary>
173173
public class DeleteTrainedModelRequestParameters : RequestParameters<DeleteTrainedModelRequestParameters>
174174
{
175+
///<summary>Controls the amount of time to wait for the model to be deleted.</summary>
176+
public TimeSpan Timeout
177+
{
178+
get => Q<TimeSpan>("timeout");
179+
set => Q("timeout", value);
180+
}
175181
}
176182

177183
///<summary>Request options for DeleteTrainedModelAlias <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models-aliases.html</para></summary>

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

+7
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ public long? Snapshots
6262
set => Q("snapshots", value);
6363
}
6464

65+
///<summary>The sort order for 'cpu' type (default: total)</summary>
66+
public Sort? Sort
67+
{
68+
get => Q<Sort? >("sort");
69+
set => Q("sort", value);
70+
}
71+
6572
///<summary>The type to sample (default: cpu)</summary>
6673
public ThreadType? ThreadType
6774
{

src/Elasticsearch.Net/ElasticLowLevelClient.Fleet.cs

+12-12
Original file line numberDiff line numberDiff line change
@@ -58,48 +58,48 @@ public TResponse GlobalCheckpoints<TResponse>(string index, GlobalCheckpointsReq
5858
[MapsApi("fleet.global_checkpoints", "index")]
5959
public Task<TResponse> GlobalCheckpointsAsync<TResponse>(string index, GlobalCheckpointsRequestParameters requestParameters = null, CancellationToken ctx = default)
6060
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(GET, Url($"{index:index}/_fleet/global_checkpoints"), ctx, null, RequestParams(requestParameters));
61-
///<summary>POST on /_fleet/_msearch</summary>
61+
///<summary>POST on /_fleet/_fleet_msearch</summary>
6262
///<param name = "body">The request definitions (metadata-fleet search request definition pairs), separated by newlines</param>
6363
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
6464
///<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>
6565
public TResponse Msearch<TResponse>(PostData body, MsearchRequestParameters requestParameters = null)
66-
where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(POST, "_fleet/_msearch", body, RequestParams(requestParameters));
67-
///<summary>POST on /_fleet/_msearch</summary>
66+
where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(POST, "_fleet/_fleet_msearch", body, RequestParams(requestParameters));
67+
///<summary>POST on /_fleet/_fleet_msearch</summary>
6868
///<param name = "body">The request definitions (metadata-fleet search request definition pairs), separated by newlines</param>
6969
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
7070
///<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>
7171
[MapsApi("fleet.msearch", "body")]
7272
public Task<TResponse> MsearchAsync<TResponse>(PostData body, MsearchRequestParameters requestParameters = null, CancellationToken ctx = default)
73-
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(POST, "_fleet/_msearch", ctx, body, RequestParams(requestParameters));
74-
///<summary>POST on /{index}/_fleet/_msearch</summary>
73+
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(POST, "_fleet/_fleet_msearch", ctx, body, RequestParams(requestParameters));
74+
///<summary>POST on /{index}/_fleet/_fleet_msearch</summary>
7575
///<param name = "index">The index name to use as the default</param>
7676
///<param name = "body">The request definitions (metadata-fleet search request definition pairs), separated by newlines</param>
7777
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
7878
///<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>
7979
public TResponse Msearch<TResponse>(string index, PostData body, MsearchRequestParameters requestParameters = null)
80-
where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(POST, Url($"{index:index}/_fleet/_msearch"), body, RequestParams(requestParameters));
81-
///<summary>POST on /{index}/_fleet/_msearch</summary>
80+
where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(POST, Url($"{index:index}/_fleet/_fleet_msearch"), body, RequestParams(requestParameters));
81+
///<summary>POST on /{index}/_fleet/_fleet_msearch</summary>
8282
///<param name = "index">The index name to use as the default</param>
8383
///<param name = "body">The request definitions (metadata-fleet search request definition pairs), separated by newlines</param>
8484
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
8585
///<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>
8686
[MapsApi("fleet.msearch", "index, body")]
8787
public Task<TResponse> MsearchAsync<TResponse>(string index, PostData body, MsearchRequestParameters requestParameters = null, CancellationToken ctx = default)
88-
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(POST, Url($"{index:index}/_fleet/_msearch"), ctx, body, RequestParams(requestParameters));
89-
///<summary>POST on /{index}/_fleet/_search</summary>
88+
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(POST, Url($"{index:index}/_fleet/_fleet_msearch"), ctx, body, RequestParams(requestParameters));
89+
///<summary>POST on /{index}/_fleet/_fleet_search</summary>
9090
///<param name = "index">The index name to search.</param>
9191
///<param name = "body">The search definition using the Query DSL</param>
9292
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
9393
///<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>
9494
public TResponse Search<TResponse>(string index, PostData body, SearchRequestParameters requestParameters = null)
95-
where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(POST, Url($"{index:index}/_fleet/_search"), body, RequestParams(requestParameters));
96-
///<summary>POST on /{index}/_fleet/_search</summary>
95+
where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(POST, Url($"{index:index}/_fleet/_fleet_search"), body, RequestParams(requestParameters));
96+
///<summary>POST on /{index}/_fleet/_fleet_search</summary>
9797
///<param name = "index">The index name to search.</param>
9898
///<param name = "body">The search definition using the Query DSL</param>
9999
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
100100
///<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>
101101
[MapsApi("fleet.search", "index, body")]
102102
public Task<TResponse> SearchAsync<TResponse>(string index, PostData body, SearchRequestParameters requestParameters = null, CancellationToken ctx = default)
103-
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(POST, Url($"{index:index}/_fleet/_search"), ctx, body, RequestParams(requestParameters));
103+
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(POST, Url($"{index:index}/_fleet/_fleet_search"), ctx, body, RequestParams(requestParameters));
104104
}
105105
}

src/Elasticsearch.Net/ElasticLowLevelClient.Indices.cs

-13
Original file line numberDiff line numberDiff line change
@@ -354,19 +354,6 @@ public TResponse ForceMerge<TResponse>(string index, ForceMergeRequestParameters
354354
[MapsApi("indices.forcemerge", "index")]
355355
public Task<TResponse> ForceMergeAsync<TResponse>(string index, ForceMergeRequestParameters requestParameters = null, CancellationToken ctx = default)
356356
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(POST, Url($"{index:index}/_forcemerge"), ctx, null, RequestParams(requestParameters));
357-
///<summary>POST on /{index}/_freeze <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html</para></summary>
358-
///<param name = "index">The name of the index to freeze</param>
359-
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
360-
[Obsolete("Deprecated in version 7.14.0: Frozen indices are deprecated because they provide no benefit given improvements in heap memory utilization. They will be removed in a future release.")]
361-
public TResponse Freeze<TResponse>(string index, FreezeIndexRequestParameters requestParameters = null)
362-
where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(POST, Url($"{index:index}/_freeze"), null, RequestParams(requestParameters));
363-
///<summary>POST on /{index}/_freeze <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/freeze-index-api.html</para></summary>
364-
///<param name = "index">The name of the index to freeze</param>
365-
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
366-
[Obsolete("Deprecated in version 7.14.0: Frozen indices are deprecated because they provide no benefit given improvements in heap memory utilization. They will be removed in a future release.")]
367-
[MapsApi("indices.freeze", "index")]
368-
public Task<TResponse> FreezeAsync<TResponse>(string index, FreezeIndexRequestParameters requestParameters = null, CancellationToken ctx = default)
369-
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(POST, Url($"{index:index}/_freeze"), ctx, null, RequestParams(requestParameters));
370357
///<summary>GET on /{index} <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html</para></summary>
371358
///<param name = "index">A comma-separated list of index names</param>
372359
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>

0 commit comments

Comments
 (0)