From 4aadb02e81ffa29d75ded0aaf406f5d0abb0f3c0 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 18 Jan 2024 12:59:00 +1300 Subject: [PATCH 1/9] Re-generate cat.plugins Signed-off-by: Thomas Farr --- .../Configuration/CodeConfiguration.cs | 3 +- src/ApiGenerator/OpenSearch.openapi.json | 61 +++++++++++--- src/OpenSearch.Client/ApiUrlsLookup.cs | 1 - src/OpenSearch.Client/Descriptors.Cat.cs | 28 ------- src/OpenSearch.Client/OpenSearchClient.Cat.cs | 24 ------ src/OpenSearch.Client/Requests.Cat.cs | 82 ------------------- .../_Generated/ApiUrlsLookup.cs | 2 + .../_Generated/Descriptors.Cat.cs | 45 ++++++++++ .../_Generated/OpenSearchClient.Cat.cs | 41 ++++++++++ .../_Generated/Requests.Cat.cs | 79 ++++++++++++++++++ .../RequestParameters.Cat.cs | 75 ----------------- .../OpenSearchLowLevelClient.Cat.cs | 9 -- src/OpenSearch.Net/_Generated/Api/Enums.cs | 7 +- .../RequestParameters.Cat.cs | 72 ++++++++++++++++ .../OpenSearchLowLevelClient.Cat.cs | 22 +++++ 15 files changed, 320 insertions(+), 231 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 7be3540059..96bdb3f4ad 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -41,7 +41,7 @@ public static class CodeConfiguration { new("{create,delete}_pit"), new("{delete,get}_all_pits"), - + new("cat.aliases"), new("cat.allocation"), new("cat.cluster_manager"), @@ -54,6 +54,7 @@ public static class CodeConfiguration new("cat.nodeattrs"), new("cat.nodes"), new("cat.pending_tasks"), + new("cat.plugins"), new("cluster.*"), new("dangling_indices.*"), diff --git a/src/ApiGenerator/OpenSearch.openapi.json b/src/ApiGenerator/OpenSearch.openapi.json index 924d029be3..dfb7e3695c 100644 --- a/src/ApiGenerator/OpenSearch.openapi.json +++ b/src/ApiGenerator/OpenSearch.openapi.json @@ -10494,7 +10494,8 @@ "thread_pool", "transport", "discovery", - "indexing_pressure" + "indexing_pressure", + "search_pipeline" ], "x-data-type": "array" }, @@ -10634,7 +10635,8 @@ "thread_pool", "transport", "discovery", - "indexing_pressure" + "indexing_pressure", + "search_pipeline" ], "x-data-type": "array" }, @@ -11282,7 +11284,8 @@ "thread_pool", "transport", "discovery", - "indexing_pressure" + "indexing_pressure", + "search_pipeline" ], "x-data-type": "array" }, @@ -11434,7 +11437,8 @@ "thread_pool", "transport", "discovery", - "indexing_pressure" + "indexing_pressure", + "search_pipeline" ], "x-data-type": "array" }, @@ -14875,6 +14879,15 @@ "default": false, "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } + }, + { + "name": "search_pipeline", + "in": "query", + "description": "Customizable sequence of processing stages applied to search queries.", + "schema": { + "type": "string", + "description": "Customizable sequence of processing stages applied to search queries." + } } ], "responses": { @@ -15359,6 +15372,15 @@ "default": false, "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } + }, + { + "name": "search_pipeline", + "in": "query", + "description": "Customizable sequence of processing stages applied to search queries.", + "schema": { + "type": "string", + "description": "Customizable sequence of processing stages applied to search queries." + } } ], "responses": { @@ -22364,7 +22386,7 @@ { "name": "op_type", "in": "query", - "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID.", + "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create` for requests without an explicit document ID.", "schema": { "$ref": "#/components/schemas/OpType" } @@ -22961,7 +22983,7 @@ { "name": "op_type", "in": "query", - "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID.", + "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create` for requests without an explicit document ID.", "schema": { "$ref": "#/components/schemas/OpType" } @@ -23109,7 +23131,7 @@ { "name": "op_type", "in": "query", - "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID.", + "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create` for requests without an explicit document ID.", "schema": { "$ref": "#/components/schemas/OpType" } @@ -26092,6 +26114,15 @@ "default": false, "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } + }, + { + "name": "search_pipeline", + "in": "query", + "description": "Customizable sequence of processing stages applied to search queries.", + "schema": { + "type": "string", + "description": "Customizable sequence of processing stages applied to search queries." + } } ], "responses": { @@ -26595,6 +26626,15 @@ "default": false, "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } + }, + { + "name": "search_pipeline", + "in": "query", + "description": "Customizable sequence of processing stages applied to search queries.", + "schema": { + "type": "string", + "description": "Customizable sequence of processing stages applied to search queries." + } } ], "responses": { @@ -26671,8 +26711,9 @@ "description": "Specify the keep alive for point in time.", "schema": { "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Specify the keep alive for point in time.", - "x-data-type": "time" + "x-data-type": "time" } }, { @@ -30720,7 +30761,7 @@ "pit_id": { "type": "string" }, - "_shard": { + "_shards": { "$ref": "#/components/schemas/ShardStatistics" }, "creation_time": { @@ -31513,7 +31554,7 @@ }, "OpType": { "type": "string", - "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID.", + "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create` for requests without an explicit document ID.", "enum": [ "index", "create" diff --git a/src/OpenSearch.Client/ApiUrlsLookup.cs b/src/OpenSearch.Client/ApiUrlsLookup.cs index dba4eda9d9..54af8fdfc2 100644 --- a/src/OpenSearch.Client/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/ApiUrlsLookup.cs @@ -46,7 +46,6 @@ namespace OpenSearch.Client internal static partial class ApiUrlsLookups { internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[]{"_bulk", "{index}/_bulk"}); - internal static ApiUrls CatPlugins = new ApiUrls(new[]{"_cat/plugins"}); internal static ApiUrls CatRecovery = new ApiUrls(new[]{"_cat/recovery", "_cat/recovery/{index}"}); internal static ApiUrls CatRepositories = new ApiUrls(new[]{"_cat/repositories"}); internal static ApiUrls CatSegments = new ApiUrls(new[]{"_cat/segments", "_cat/segments/{index}"}); diff --git a/src/OpenSearch.Client/Descriptors.Cat.cs b/src/OpenSearch.Client/Descriptors.Cat.cs index 94a072c8b9..4dc0710ebc 100644 --- a/src/OpenSearch.Client/Descriptors.Cat.cs +++ b/src/OpenSearch.Client/Descriptors.Cat.cs @@ -57,34 +57,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - ///Descriptor for Plugins https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/ - public partial class CatPluginsDescriptor : RequestDescriptorBase, ICatPluginsRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatPlugins; - // values part of the url path - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public CatPluginsDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatPluginsDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatPluginsDescriptor Help(bool? help = true) => Qs("help", help); - ///Include bootstrap plugins in the response - public CatPluginsDescriptor IncludeBootstrap(bool? includebootstrap = true) => Qs("include_bootstrap", includebootstrap); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public CatPluginsDescriptor Local(bool? local = true) => Qs("local", local); - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CatPluginsDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Explicit operation timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CatPluginsDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Comma-separated list of column names or column aliases to sort by - public CatPluginsDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatPluginsDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - ///Descriptor for Recovery https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ public partial class CatRecoveryDescriptor : RequestDescriptorBase, ICatRecoveryRequest { diff --git a/src/OpenSearch.Client/OpenSearchClient.Cat.cs b/src/OpenSearch.Client/OpenSearchClient.Cat.cs index e34740a232..dccf6c3ed5 100644 --- a/src/OpenSearch.Client/OpenSearchClient.Cat.cs +++ b/src/OpenSearch.Client/OpenSearchClient.Cat.cs @@ -59,30 +59,6 @@ namespace OpenSearch.Client.Specification.CatApi /// public partial class CatNamespace : NamespacedClientProxy { - /// - /// GET request to the cat.plugins API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/ - /// - public CatResponse Plugins(Func selector = null) => Plugins(selector.InvokeOrDefault(new CatPluginsDescriptor())); - /// - /// GET request to the cat.plugins API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/ - /// - public Task> PluginsAsync(Func selector = null, CancellationToken ct = default) => PluginsAsync(selector.InvokeOrDefault(new CatPluginsDescriptor()), ct); - /// - /// GET request to the cat.plugins API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/ - /// - public CatResponse Plugins(ICatPluginsRequest request) => DoCat(request); - /// - /// GET request to the cat.plugins API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/ - /// - public Task> PluginsAsync(ICatPluginsRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); /// /// GET request to the cat.recovery API, read more about this API online: /// diff --git a/src/OpenSearch.Client/Requests.Cat.cs b/src/OpenSearch.Client/Requests.Cat.cs index 58769013d6..22dad77fdb 100644 --- a/src/OpenSearch.Client/Requests.Cat.cs +++ b/src/OpenSearch.Client/Requests.Cat.cs @@ -58,88 +58,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - [InterfaceDataContract] - public partial interface ICatPluginsRequest : IRequest - { - } - - ///Request for Plugins https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/ - public partial class CatPluginsRequest : PlainRequestBase, ICatPluginsRequest - { - protected ICatPluginsRequest Self => this; - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatPlugins; - // values part of the url path - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public string Format - { - get => Q("format"); - set - { - Q("format", value); - SetAcceptHeader(value); - } - } - - ///Comma-separated list of column names to display - public string[] Headers - { - get => Q("h"); - set => Q("h", value); - } - - ///Return help information - public bool? Help - { - get => Q("help"); - set => Q("help", value); - } - - ///Include bootstrap plugins in the response - public bool? IncludeBootstrap - { - get => Q("include_bootstrap"); - set => Q("include_bootstrap", value); - } - - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public bool? Local - { - get => Q("local"); - set => Q("local", value); - } - - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public Time MasterTimeout - { - get => Q public partial class LowLevelCatNamespace : NamespacedClientProxy { - ///GET on /_cat/plugins https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - public TResponse Plugins(CatPluginsRequestParameters requestParameters = null) - where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, "_cat/plugins", null, RequestParams(requestParameters)); - ///GET on /_cat/plugins https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - [MapsApi("cat.plugins", "")] - public Task PluginsAsync(CatPluginsRequestParameters requestParameters = null, CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, "_cat/plugins", ctx, null, RequestParams(requestParameters)); ///GET on /_cat/recovery https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ ///Request specific configuration such as querystring parameters & request specific connection settings. public TResponse Recovery(CatRecoveryRequestParameters requestParameters = null) diff --git a/src/OpenSearch.Net/_Generated/Api/Enums.cs b/src/OpenSearch.Net/_Generated/Api/Enums.cs index be4655a46f..7971c804cf 100644 --- a/src/OpenSearch.Net/_Generated/Api/Enums.cs +++ b/src/OpenSearch.Net/_Generated/Api/Enums.cs @@ -208,8 +208,11 @@ public enum NodesStatsMetric [EnumMember(Value = "indexing_pressure")] IndexingPressure = 1 << 10, + [EnumMember(Value = "search_pipeline")] + SearchPipeline = 1 << 11, + [EnumMember(Value = "_all")] - All = 1 << 11 + All = 1 << 12 } [Flags, StringEnum] @@ -548,6 +551,8 @@ public static string GetStringValue(this NodesStatsMetric enumValue) list.Add("discovery"); if ((enumValue & NodesStatsMetric.IndexingPressure) != 0) list.Add("indexing_pressure"); + if ((enumValue & NodesStatsMetric.SearchPipeline) != 0) + list.Add("search_pipeline"); return string.Join(",", list); } diff --git a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs index 138cdec9fa..00fdaea5ca 100644 --- a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs +++ b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs @@ -854,4 +854,76 @@ public bool? Verbose set => Q("v", value); } } + + /// Request options for Plugins https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + public partial class CatPluginsRequestParameters + : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.GET; + public override bool SupportsBody => false; + + /// Operation timeout for connection to cluster-manager node. + /// Supported by OpenSearch servers of version 2.0.0 or greater. + public TimeSpan ClusterManagerTimeout + { + get => Q("cluster_manager_timeout"); + set => Q("cluster_manager_timeout", value); + } + + /// A short version of the Accept header, e.g. json, yaml. + public string Format + { + get => Q("format"); + set + { + Q("format", value); + SetAcceptHeader(value); + } + } + + /// Comma-separated list of column names to display. + public string[] Headers + { + get => Q("h"); + set => Q("h", value); + } + + /// Return help information. + public bool? Help + { + get => Q("help"); + set => Q("help", value); + } + + /// Return local information, do not retrieve the state from cluster-manager node. + public bool? Local + { + get => Q("local"); + set => Q("local", value); + } + + /// Operation timeout for connection to master node. + [Obsolete( + "Deprecated as of: 2.0.0, reason: To promote inclusive language, use 'cluster_manager_timeout' instead." + )] + public TimeSpan MasterTimeout + { + get => Q("master_timeout"); + set => Q("master_timeout", value); + } + + /// Comma-separated list of column names or column aliases to sort by. + public string[] SortByColumns + { + get => Q("s"); + set => Q("s", value); + } + + /// Verbose mode. Display column headers. + public bool? Verbose + { + get => Q("v"); + set => Q("v", value); + } + } } diff --git a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs index 283fc2ba5c..8c8b374b7a 100644 --- a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs +++ b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs @@ -516,5 +516,27 @@ public Task PendingTasksAsync( null, RequestParams(requestParameters) ); + + /// GET on /_cat/plugins https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + public TResponse Plugins(CatPluginsRequestParameters requestParameters = null) + where TResponse : class, IOpenSearchResponse, new() => + DoRequest(GET, "_cat/plugins", null, RequestParams(requestParameters)); + + /// GET on /_cat/plugins https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + [MapsApi("cat.plugins", "")] + public Task PluginsAsync( + CatPluginsRequestParameters requestParameters = null, + CancellationToken ctx = default + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequestAsync( + GET, + "_cat/plugins", + ctx, + null, + RequestParams(requestParameters) + ); } } From 72e7ead99c71bcfcf7ea2b10c0a21900e3f6f1df Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 18 Jan 2024 16:24:32 +1300 Subject: [PATCH 2/9] Re-generate cat.recovery Signed-off-by: Thomas Farr --- .../Configuration/CodeConfiguration.cs | 1 + src/OpenSearch.Client/ApiUrlsLookup.cs | 1 - src/OpenSearch.Client/Descriptors.Cat.cs | 43 --------- src/OpenSearch.Client/OpenSearchClient.Cat.cs | 24 ----- src/OpenSearch.Client/Requests.Cat.cs | 91 ------------------- .../_Generated/ApiUrlsLookup.cs | 3 + .../_Generated/Descriptors.Cat.cs | 63 +++++++++++++ .../_Generated/OpenSearchClient.Cat.cs | 41 +++++++++ .../_Generated/Requests.Cat.cs | 90 ++++++++++++++++++ .../RequestParameters.Cat.cs | 73 --------------- .../OpenSearchLowLevelClient.Cat.cs | 20 ---- .../RequestParameters.Cat.cs | 75 +++++++++++++++ .../OpenSearchLowLevelClient.Cat.cs | 55 +++++++++++ 13 files changed, 328 insertions(+), 252 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 96bdb3f4ad..7cdf236e3c 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -55,6 +55,7 @@ public static class CodeConfiguration new("cat.nodes"), new("cat.pending_tasks"), new("cat.plugins"), + new("cat.recovery"), new("cluster.*"), new("dangling_indices.*"), diff --git a/src/OpenSearch.Client/ApiUrlsLookup.cs b/src/OpenSearch.Client/ApiUrlsLookup.cs index 54af8fdfc2..d9c826006a 100644 --- a/src/OpenSearch.Client/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/ApiUrlsLookup.cs @@ -46,7 +46,6 @@ namespace OpenSearch.Client internal static partial class ApiUrlsLookups { internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[]{"_bulk", "{index}/_bulk"}); - internal static ApiUrls CatRecovery = new ApiUrls(new[]{"_cat/recovery", "_cat/recovery/{index}"}); internal static ApiUrls CatRepositories = new ApiUrls(new[]{"_cat/repositories"}); internal static ApiUrls CatSegments = new ApiUrls(new[]{"_cat/segments", "_cat/segments/{index}"}); internal static ApiUrls CatShards = new ApiUrls(new[]{"_cat/shards", "_cat/shards/{index}"}); diff --git a/src/OpenSearch.Client/Descriptors.Cat.cs b/src/OpenSearch.Client/Descriptors.Cat.cs index 4dc0710ebc..1e167bca45 100644 --- a/src/OpenSearch.Client/Descriptors.Cat.cs +++ b/src/OpenSearch.Client/Descriptors.Cat.cs @@ -57,49 +57,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - ///Descriptor for Recovery https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - public partial class CatRecoveryDescriptor : RequestDescriptorBase, ICatRecoveryRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatRecovery; - ////_cat/recovery - public CatRecoveryDescriptor(): base() - { - } - - ////_cat/recovery/{index} - ///Optional, accepts null - public CatRecoveryDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Indices ICatRecoveryRequest.Index => Self.RouteValues.Get("index"); - ///Comma-separated list or wildcard expression of index names to limit the returned information - public CatRecoveryDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public CatRecoveryDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public CatRecoveryDescriptor AllIndices() => Index(Indices.All); - // Request parameters - ///If `true`, the response only includes ongoing shard recoveries - public CatRecoveryDescriptor ActiveOnly(bool? activeonly = true) => Qs("active_only", activeonly); - ///The unit in which to display byte values - public CatRecoveryDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes); - ///If `true`, the response includes detailed information about shard recoveries - public CatRecoveryDescriptor Detailed(bool? detailed = true) => Qs("detailed", detailed); - ///a short version of the Accept header, e.g. json, yaml - public CatRecoveryDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatRecoveryDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatRecoveryDescriptor Help(bool? help = true) => Qs("help", help); - ///Comma-separated list of column names or column aliases to sort by - public CatRecoveryDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatRecoveryDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - ///Descriptor for Repositories https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ public partial class CatRepositoriesDescriptor : RequestDescriptorBase, ICatRepositoriesRequest { diff --git a/src/OpenSearch.Client/OpenSearchClient.Cat.cs b/src/OpenSearch.Client/OpenSearchClient.Cat.cs index dccf6c3ed5..dd72893cc4 100644 --- a/src/OpenSearch.Client/OpenSearchClient.Cat.cs +++ b/src/OpenSearch.Client/OpenSearchClient.Cat.cs @@ -59,30 +59,6 @@ namespace OpenSearch.Client.Specification.CatApi /// public partial class CatNamespace : NamespacedClientProxy { - /// - /// GET request to the cat.recovery API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - /// - public CatResponse Recovery(Func selector = null) => Recovery(selector.InvokeOrDefault(new CatRecoveryDescriptor())); - /// - /// GET request to the cat.recovery API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - /// - public Task> RecoveryAsync(Func selector = null, CancellationToken ct = default) => RecoveryAsync(selector.InvokeOrDefault(new CatRecoveryDescriptor()), ct); - /// - /// GET request to the cat.recovery API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - /// - public CatResponse Recovery(ICatRecoveryRequest request) => DoCat(request); - /// - /// GET request to the cat.recovery API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - /// - public Task> RecoveryAsync(ICatRecoveryRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); /// /// GET request to the cat.repositories API, read more about this API online: /// diff --git a/src/OpenSearch.Client/Requests.Cat.cs b/src/OpenSearch.Client/Requests.Cat.cs index 22dad77fdb..c146158049 100644 --- a/src/OpenSearch.Client/Requests.Cat.cs +++ b/src/OpenSearch.Client/Requests.Cat.cs @@ -58,97 +58,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - [InterfaceDataContract] - public partial interface ICatRecoveryRequest : IRequest - { - [IgnoreDataMember] - Indices Index - { - get; - } - } - - ///Request for Recovery https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - public partial class CatRecoveryRequest : PlainRequestBase, ICatRecoveryRequest - { - protected ICatRecoveryRequest Self => this; - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatRecovery; - ////_cat/recovery - public CatRecoveryRequest(): base() - { - } - - ////_cat/recovery/{index} - ///Optional, accepts null - public CatRecoveryRequest(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - [IgnoreDataMember] - Indices ICatRecoveryRequest.Index => Self.RouteValues.Get("index"); - // Request parameters - ///If `true`, the response only includes ongoing shard recoveries - public bool? ActiveOnly - { - get => Q("active_only"); - set => Q("active_only", value); - } - - ///The unit in which to display byte values - public Bytes? Bytes - { - get => Q("bytes"); - set => Q("bytes", value); - } - - ///If `true`, the response includes detailed information about shard recoveries - public bool? Detailed - { - get => Q("detailed"); - set => Q("detailed", value); - } - - ///a short version of the Accept header, e.g. json, yaml - public string Format - { - get => Q("format"); - set - { - Q("format", value); - SetAcceptHeader(value); - } - } - - ///Comma-separated list of column names to display - public string[] Headers - { - get => Q("h"); - set => Q("h", value); - } - - ///Return help information - public bool? Help - { - get => Q("help"); - set => Q("help", value); - } - - ///Comma-separated list of column names or column aliases to sort by - public string[] SortByColumns - { - get => Q("s"); - set => Q("s", value); - } - - ///Verbose mode. Display column headers - public bool? Verbose - { - get => Q("v"); - set => Q("v", value); - } - } - [InterfaceDataContract] public partial interface ICatRepositoriesRequest : IRequest { diff --git a/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs b/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs index 80261370bd..f2fbd8cc6d 100644 --- a/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs @@ -76,6 +76,9 @@ internal static partial class ApiUrlsLookups internal static readonly ApiUrls CatPlugins = new(new[] { "_cat/plugins" }); + internal static readonly ApiUrls CatRecovery = + new(new[] { "_cat/recovery", "_cat/recovery/{index}" }); + internal static readonly ApiUrls ClusterAllocationExplain = new(new[] { "_cluster/allocation/explain" }); diff --git a/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs b/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs index 45135cd7de..4c7939f321 100644 --- a/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs +++ b/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs @@ -675,4 +675,67 @@ public CatPluginsDescriptor SortByColumns(params string[] sortbycolumns) => /// Verbose mode. Display column headers. public CatPluginsDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); } + + /// Descriptor for Recovery https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + public partial class CatRecoveryDescriptor + : RequestDescriptorBase< + CatRecoveryDescriptor, + CatRecoveryRequestParameters, + ICatRecoveryRequest + >, + ICatRecoveryRequest + { + internal override ApiUrls ApiUrls => ApiUrlsLookups.CatRecovery; + + /// /_cat/recovery + public CatRecoveryDescriptor() + : base() { } + + /// /_cat/recovery/{index} + /// Optional, accepts null + public CatRecoveryDescriptor(Indices index) + : base(r => r.Optional("index", index)) { } + + // values part of the url path + Indices ICatRecoveryRequest.Index => Self.RouteValues.Get("index"); + + /// Comma-separated list or wildcard expression of index names to limit the returned information. + public CatRecoveryDescriptor Index(Indices index) => + Assign(index, (a, v) => a.RouteValues.Optional("index", v)); + + /// a shortcut into calling Index(typeof(TOther)) + public CatRecoveryDescriptor Index() + where TOther : class => + Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); + + /// A shortcut into calling Index(Indices.All) + public CatRecoveryDescriptor AllIndices() => Index(Indices.All); + + // Request parameters + /// If `true`, the response only includes ongoing shard recoveries. + public CatRecoveryDescriptor ActiveOnly(bool? activeonly = true) => + Qs("active_only", activeonly); + + /// The unit in which to display byte values. + public CatRecoveryDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes); + + /// If `true`, the response includes detailed information about shard recoveries. + public CatRecoveryDescriptor Detailed(bool? detailed = true) => Qs("detailed", detailed); + + /// A short version of the Accept header, e.g. json, yaml. + public CatRecoveryDescriptor Format(string format) => Qs("format", format); + + /// Comma-separated list of column names to display. + public CatRecoveryDescriptor Headers(params string[] headers) => Qs("h", headers); + + /// Return help information. + public CatRecoveryDescriptor Help(bool? help = true) => Qs("help", help); + + /// Comma-separated list of column names or column aliases to sort by. + public CatRecoveryDescriptor SortByColumns(params string[] sortbycolumns) => + Qs("s", sortbycolumns); + + /// Verbose mode. Display column headers. + public CatRecoveryDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); + } } diff --git a/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs b/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs index 5eb46387b3..75b598c61a 100644 --- a/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs +++ b/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs @@ -611,5 +611,46 @@ public Task> PluginsAsync( request, ct ); + + /// + /// GET request to the cat.recovery API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + /// + public CatResponse Recovery( + Func selector = null + ) => Recovery(selector.InvokeOrDefault(new CatRecoveryDescriptor())); + + /// + /// GET request to the cat.recovery API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + /// + public Task> RecoveryAsync( + Func selector = null, + CancellationToken ct = default + ) => RecoveryAsync(selector.InvokeOrDefault(new CatRecoveryDescriptor()), ct); + + /// + /// GET request to the cat.recovery API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + /// + public CatResponse Recovery(ICatRecoveryRequest request) => + DoCat(request); + + /// + /// GET request to the cat.recovery API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + /// + public Task> RecoveryAsync( + ICatRecoveryRequest request, + CancellationToken ct = default + ) => + DoCatAsync( + request, + ct + ); } } diff --git a/src/OpenSearch.Client/_Generated/Requests.Cat.cs b/src/OpenSearch.Client/_Generated/Requests.Cat.cs index 8a9905b92e..1ceb80e031 100644 --- a/src/OpenSearch.Client/_Generated/Requests.Cat.cs +++ b/src/OpenSearch.Client/_Generated/Requests.Cat.cs @@ -1099,4 +1099,94 @@ public bool? Verbose set => Q("v", value); } } + + [InterfaceDataContract] + public partial interface ICatRecoveryRequest : IRequest + { + [IgnoreDataMember] + Indices Index { get; } + } + + /// Request for Recovery https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + public partial class CatRecoveryRequest + : PlainRequestBase, + ICatRecoveryRequest + { + protected ICatRecoveryRequest Self => this; + internal override ApiUrls ApiUrls => ApiUrlsLookups.CatRecovery; + + /// /_cat/recovery + public CatRecoveryRequest() + : base() { } + + /// /_cat/recovery/{index} + /// Optional, accepts null + public CatRecoveryRequest(Indices index) + : base(r => r.Optional("index", index)) { } + + // values part of the url path + [IgnoreDataMember] + Indices ICatRecoveryRequest.Index => Self.RouteValues.Get("index"); + + // Request parameters + /// If `true`, the response only includes ongoing shard recoveries. + public bool? ActiveOnly + { + get => Q("active_only"); + set => Q("active_only", value); + } + + /// The unit in which to display byte values. + public Bytes? Bytes + { + get => Q("bytes"); + set => Q("bytes", value); + } + + /// If `true`, the response includes detailed information about shard recoveries. + public bool? Detailed + { + get => Q("detailed"); + set => Q("detailed", value); + } + + /// A short version of the Accept header, e.g. json, yaml. + public string Format + { + get => Q("format"); + set + { + Q("format", value); + SetAcceptHeader(value); + } + } + + /// Comma-separated list of column names to display. + public string[] Headers + { + get => Q("h"); + set => Q("h", value); + } + + /// Return help information. + public bool? Help + { + get => Q("help"); + set => Q("help", value); + } + + /// Comma-separated list of column names or column aliases to sort by. + public string[] SortByColumns + { + get => Q("s"); + set => Q("s", value); + } + + /// Verbose mode. Display column headers. + public bool? Verbose + { + get => Q("v"); + set => Q("v", value); + } + } } diff --git a/src/OpenSearch.Net/Api/RequestParameters/RequestParameters.Cat.cs b/src/OpenSearch.Net/Api/RequestParameters/RequestParameters.Cat.cs index a107691ff8..5f4ab9e79c 100644 --- a/src/OpenSearch.Net/Api/RequestParameters/RequestParameters.Cat.cs +++ b/src/OpenSearch.Net/Api/RequestParameters/RequestParameters.Cat.cs @@ -51,79 +51,6 @@ // ReSharper disable once CheckNamespace namespace OpenSearch.Net.Specification.CatApi { - ///Request options for Recovery https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - public class CatRecoveryRequestParameters : RequestParameters - { - public override HttpMethod DefaultHttpMethod => HttpMethod.GET; - public override bool SupportsBody => false; - ///If `true`, the response only includes ongoing shard recoveries - public bool? ActiveOnly - { - get => Q("active_only"); - set => Q("active_only", value); - } - - ///The unit in which to display byte values - public Bytes? Bytes - { - get => Q("bytes"); - set => Q("bytes", value); - } - - ///If `true`, the response includes detailed information about shard recoveries - public bool? Detailed - { - get => Q("detailed"); - set => Q("detailed", value); - } - - ///a short version of the Accept header, e.g. json, yaml - public string Format - { - get => Q("format"); - set - { - Q("format", value); - SetAcceptHeader(value); - } - } - - ///Comma-separated list of column names to display - public string[] Headers - { - get => Q("h"); - set => Q("h", value); - } - - ///Return help information - public bool? Help - { - get => Q("help"); - set => Q("help", value); - } - - ///Comma-separated list or wildcard expression of index names to limit the returned information - public string[] IndexQueryString - { - get => Q("index"); - set => Q("index", value); - } - - ///Comma-separated list of column names or column aliases to sort by - public string[] SortByColumns - { - get => Q("s"); - set => Q("s", value); - } - - ///Verbose mode. Display column headers - public bool? Verbose - { - get => Q("v"); - set => Q("v", value); - } - } - ///Request options for Repositories https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ public class CatRepositoriesRequestParameters : RequestParameters { diff --git a/src/OpenSearch.Net/OpenSearchLowLevelClient.Cat.cs b/src/OpenSearch.Net/OpenSearchLowLevelClient.Cat.cs index 309745ee71..d817055d30 100644 --- a/src/OpenSearch.Net/OpenSearchLowLevelClient.Cat.cs +++ b/src/OpenSearch.Net/OpenSearchLowLevelClient.Cat.cs @@ -66,26 +66,6 @@ namespace OpenSearch.Net.Specification.CatApi /// public partial class LowLevelCatNamespace : NamespacedClientProxy { - ///GET on /_cat/recovery https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - public TResponse Recovery(CatRecoveryRequestParameters requestParameters = null) - where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, "_cat/recovery", null, RequestParams(requestParameters)); - ///GET on /_cat/recovery https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - [MapsApi("cat.recovery", "")] - public Task RecoveryAsync(CatRecoveryRequestParameters requestParameters = null, CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, "_cat/recovery", ctx, null, RequestParams(requestParameters)); - ///GET on /_cat/recovery/{index} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - ///Comma-separated list or wildcard expression of index names to limit the returned information - ///Request specific configuration such as querystring parameters & request specific connection settings. - public TResponse Recovery(string index, CatRecoveryRequestParameters requestParameters = null) - where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, Url($"_cat/recovery/{index:index}"), null, RequestParams(requestParameters)); - ///GET on /_cat/recovery/{index} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/ - ///Comma-separated list or wildcard expression of index names to limit the returned information - ///Request specific configuration such as querystring parameters & request specific connection settings. - [MapsApi("cat.recovery", "index")] - public Task RecoveryAsync(string index, CatRecoveryRequestParameters requestParameters = null, CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, Url($"_cat/recovery/{index:index}"), ctx, null, RequestParams(requestParameters)); ///GET on /_cat/repositories https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ ///Request specific configuration such as querystring parameters & request specific connection settings. public TResponse Repositories(CatRepositoriesRequestParameters requestParameters = null) diff --git a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs index 00fdaea5ca..7fabd5437d 100644 --- a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs +++ b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs @@ -926,4 +926,79 @@ public bool? Verbose set => Q("v", value); } } + + /// Request options for Recovery https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + public partial class CatRecoveryRequestParameters + : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.GET; + public override bool SupportsBody => false; + + /// If `true`, the response only includes ongoing shard recoveries. + public bool? ActiveOnly + { + get => Q("active_only"); + set => Q("active_only", value); + } + + /// The unit in which to display byte values. + public Bytes? Bytes + { + get => Q("bytes"); + set => Q("bytes", value); + } + + /// If `true`, the response includes detailed information about shard recoveries. + public bool? Detailed + { + get => Q("detailed"); + set => Q("detailed", value); + } + + /// A short version of the Accept header, e.g. json, yaml. + public string Format + { + get => Q("format"); + set + { + Q("format", value); + SetAcceptHeader(value); + } + } + + /// Comma-separated list of column names to display. + public string[] Headers + { + get => Q("h"); + set => Q("h", value); + } + + /// Return help information. + public bool? Help + { + get => Q("help"); + set => Q("help", value); + } + + /// Comma-separated list or wildcard expression of index names to limit the returned information. + public string[] IndexQueryString + { + get => Q("index"); + set => Q("index", value); + } + + /// Comma-separated list of column names or column aliases to sort by. + public string[] SortByColumns + { + get => Q("s"); + set => Q("s", value); + } + + /// Verbose mode. Display column headers. + public bool? Verbose + { + get => Q("v"); + set => Q("v", value); + } + } } diff --git a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs index 8c8b374b7a..e7d7c491f3 100644 --- a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs +++ b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs @@ -538,5 +538,60 @@ public Task PluginsAsync( null, RequestParams(requestParameters) ); + + /// GET on /_cat/recovery https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + public TResponse Recovery(CatRecoveryRequestParameters requestParameters = null) + where TResponse : class, IOpenSearchResponse, new() => + DoRequest(GET, "_cat/recovery", null, RequestParams(requestParameters)); + + /// GET on /_cat/recovery https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + [MapsApi("cat.recovery", "")] + public Task RecoveryAsync( + CatRecoveryRequestParameters requestParameters = null, + CancellationToken ctx = default + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequestAsync( + GET, + "_cat/recovery", + ctx, + null, + RequestParams(requestParameters) + ); + + /// GET on /_cat/recovery/{index} https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + /// Comma-separated list or wildcard expression of index names to limit the returned information. + /// Request specific configuration such as querystring parameters & request specific connection settings. + public TResponse Recovery( + string index, + CatRecoveryRequestParameters requestParameters = null + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequest( + GET, + Url($"_cat/recovery/{index:index}"), + null, + RequestParams(requestParameters) + ); + + /// GET on /_cat/recovery/{index} https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + /// Comma-separated list or wildcard expression of index names to limit the returned information. + /// Request specific configuration such as querystring parameters & request specific connection settings. + [MapsApi("cat.recovery", "index")] + public Task RecoveryAsync( + string index, + CatRecoveryRequestParameters requestParameters = null, + CancellationToken ctx = default + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequestAsync( + GET, + Url($"_cat/recovery/{index:index}"), + ctx, + null, + RequestParams(requestParameters) + ); } } From 23af49682eab0f02b42b427587d497aaa7a2af47 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 18 Jan 2024 16:34:40 +1300 Subject: [PATCH 3/9] Re-generate cat.repositories Signed-off-by: Thomas Farr --- .../Configuration/CodeConfiguration.cs | 1 + src/OpenSearch.Client/ApiUrlsLookup.cs | 1 - src/OpenSearch.Client/Descriptors.Cat.cs | 26 ------ src/OpenSearch.Client/OpenSearchClient.Cat.cs | 24 ------ src/OpenSearch.Client/Requests.Cat.cs | 75 ----------------- .../_Generated/ApiUrlsLookup.cs | 2 + .../_Generated/Descriptors.Cat.cs | 45 +++++++++++ .../_Generated/OpenSearchClient.Cat.cs | 44 ++++++++++ .../_Generated/Requests.Cat.cs | 80 +++++++++++++++++++ .../RequestParameters.Cat.cs | 68 ---------------- .../OpenSearchLowLevelClient.Cat.cs | 9 --- .../RequestParameters.Cat.cs | 72 +++++++++++++++++ .../OpenSearchLowLevelClient.Cat.cs | 24 ++++++ 13 files changed, 268 insertions(+), 203 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 7cdf236e3c..e8742c710e 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -56,6 +56,7 @@ public static class CodeConfiguration new("cat.pending_tasks"), new("cat.plugins"), new("cat.recovery"), + new("cat.repositories"), new("cluster.*"), new("dangling_indices.*"), diff --git a/src/OpenSearch.Client/ApiUrlsLookup.cs b/src/OpenSearch.Client/ApiUrlsLookup.cs index d9c826006a..faad2b7f24 100644 --- a/src/OpenSearch.Client/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/ApiUrlsLookup.cs @@ -46,7 +46,6 @@ namespace OpenSearch.Client internal static partial class ApiUrlsLookups { internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[]{"_bulk", "{index}/_bulk"}); - internal static ApiUrls CatRepositories = new ApiUrls(new[]{"_cat/repositories"}); internal static ApiUrls CatSegments = new ApiUrls(new[]{"_cat/segments", "_cat/segments/{index}"}); internal static ApiUrls CatShards = new ApiUrls(new[]{"_cat/shards", "_cat/shards/{index}"}); internal static ApiUrls CatSnapshots = new ApiUrls(new[]{"_cat/snapshots", "_cat/snapshots/{repository}"}); diff --git a/src/OpenSearch.Client/Descriptors.Cat.cs b/src/OpenSearch.Client/Descriptors.Cat.cs index 1e167bca45..562ddc0151 100644 --- a/src/OpenSearch.Client/Descriptors.Cat.cs +++ b/src/OpenSearch.Client/Descriptors.Cat.cs @@ -57,32 +57,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - ///Descriptor for Repositories https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ - public partial class CatRepositoriesDescriptor : RequestDescriptorBase, ICatRepositoriesRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatRepositories; - // values part of the url path - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public CatRepositoriesDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatRepositoriesDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatRepositoriesDescriptor Help(bool? help = true) => Qs("help", help); - ///Return local information, do not retrieve the state from cluster_manager node - public CatRepositoriesDescriptor Local(bool? local = true) => Qs("local", local); - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CatRepositoriesDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Explicit operation timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CatRepositoriesDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Comma-separated list of column names or column aliases to sort by - public CatRepositoriesDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatRepositoriesDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - ///Descriptor for Segments https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ public partial class CatSegmentsDescriptor : RequestDescriptorBase, ICatSegmentsRequest { diff --git a/src/OpenSearch.Client/OpenSearchClient.Cat.cs b/src/OpenSearch.Client/OpenSearchClient.Cat.cs index dd72893cc4..36496ffcf1 100644 --- a/src/OpenSearch.Client/OpenSearchClient.Cat.cs +++ b/src/OpenSearch.Client/OpenSearchClient.Cat.cs @@ -59,30 +59,6 @@ namespace OpenSearch.Client.Specification.CatApi /// public partial class CatNamespace : NamespacedClientProxy { - /// - /// GET request to the cat.repositories API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ - /// - public CatResponse Repositories(Func selector = null) => Repositories(selector.InvokeOrDefault(new CatRepositoriesDescriptor())); - /// - /// GET request to the cat.repositories API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ - /// - public Task> RepositoriesAsync(Func selector = null, CancellationToken ct = default) => RepositoriesAsync(selector.InvokeOrDefault(new CatRepositoriesDescriptor()), ct); - /// - /// GET request to the cat.repositories API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ - /// - public CatResponse Repositories(ICatRepositoriesRequest request) => DoCat(request); - /// - /// GET request to the cat.repositories API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ - /// - public Task> RepositoriesAsync(ICatRepositoriesRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); /// /// GET request to the cat.segments API, read more about this API online: /// diff --git a/src/OpenSearch.Client/Requests.Cat.cs b/src/OpenSearch.Client/Requests.Cat.cs index c146158049..9e7e91ade3 100644 --- a/src/OpenSearch.Client/Requests.Cat.cs +++ b/src/OpenSearch.Client/Requests.Cat.cs @@ -58,81 +58,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - [InterfaceDataContract] - public partial interface ICatRepositoriesRequest : IRequest - { - } - - ///Request for Repositories https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ - public partial class CatRepositoriesRequest : PlainRequestBase, ICatRepositoriesRequest - { - protected ICatRepositoriesRequest Self => this; - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatRepositories; - // values part of the url path - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public string Format - { - get => Q("format"); - set - { - Q("format", value); - SetAcceptHeader(value); - } - } - - ///Comma-separated list of column names to display - public string[] Headers - { - get => Q("h"); - set => Q("h", value); - } - - ///Return help information - public bool? Help - { - get => Q("help"); - set => Q("help", value); - } - - ///Return local information, do not retrieve the state from cluster_manager node - public bool? Local - { - get => Q("local"); - set => Q("local", value); - } - - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public Time MasterTimeout - { - get => Q public partial class LowLevelCatNamespace : NamespacedClientProxy { - ///GET on /_cat/repositories https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - public TResponse Repositories(CatRepositoriesRequestParameters requestParameters = null) - where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, "_cat/repositories", null, RequestParams(requestParameters)); - ///GET on /_cat/repositories https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - [MapsApi("cat.repositories", "")] - public Task RepositoriesAsync(CatRepositoriesRequestParameters requestParameters = null, CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, "_cat/repositories", ctx, null, RequestParams(requestParameters)); ///GET on /_cat/segments https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ ///Request specific configuration such as querystring parameters & request specific connection settings. public TResponse Segments(CatSegmentsRequestParameters requestParameters = null) diff --git a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs index 7fabd5437d..b762f50e1e 100644 --- a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs +++ b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs @@ -1001,4 +1001,76 @@ public bool? Verbose set => Q("v", value); } } + + /// Request options for Repositories https://opensearch.org/docs/latest/api-reference/cat/cat-repositories/ + public partial class CatRepositoriesRequestParameters + : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.GET; + public override bool SupportsBody => false; + + /// Operation timeout for connection to cluster-manager node. + /// Supported by OpenSearch servers of version 2.0.0 or greater. + public TimeSpan ClusterManagerTimeout + { + get => Q("cluster_manager_timeout"); + set => Q("cluster_manager_timeout", value); + } + + /// A short version of the Accept header, e.g. json, yaml. + public string Format + { + get => Q("format"); + set + { + Q("format", value); + SetAcceptHeader(value); + } + } + + /// Comma-separated list of column names to display. + public string[] Headers + { + get => Q("h"); + set => Q("h", value); + } + + /// Return help information. + public bool? Help + { + get => Q("help"); + set => Q("help", value); + } + + /// Return local information, do not retrieve the state from cluster-manager node. + public bool? Local + { + get => Q("local"); + set => Q("local", value); + } + + /// Operation timeout for connection to master node. + [Obsolete( + "Deprecated as of: 2.0.0, reason: To promote inclusive language, use 'cluster_manager_timeout' instead." + )] + public TimeSpan MasterTimeout + { + get => Q("master_timeout"); + set => Q("master_timeout", value); + } + + /// Comma-separated list of column names or column aliases to sort by. + public string[] SortByColumns + { + get => Q("s"); + set => Q("s", value); + } + + /// Verbose mode. Display column headers. + public bool? Verbose + { + get => Q("v"); + set => Q("v", value); + } + } } diff --git a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs index e7d7c491f3..d02b9247ea 100644 --- a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs +++ b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs @@ -593,5 +593,29 @@ public Task RecoveryAsync( null, RequestParams(requestParameters) ); + + /// GET on /_cat/repositories https://opensearch.org/docs/latest/api-reference/cat/cat-repositories/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + public TResponse Repositories( + CatRepositoriesRequestParameters requestParameters = null + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequest(GET, "_cat/repositories", null, RequestParams(requestParameters)); + + /// GET on /_cat/repositories https://opensearch.org/docs/latest/api-reference/cat/cat-repositories/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + [MapsApi("cat.repositories", "")] + public Task RepositoriesAsync( + CatRepositoriesRequestParameters requestParameters = null, + CancellationToken ctx = default + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequestAsync( + GET, + "_cat/repositories", + ctx, + null, + RequestParams(requestParameters) + ); } } From 2482f7ce33b888a387e20b817236c2564b055c5a Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 18 Jan 2024 16:45:41 +1300 Subject: [PATCH 4/9] Re-generate cat.segments Signed-off-by: Thomas Farr --- .../Configuration/CodeConfiguration.cs | 1 + src/OpenSearch.Client/ApiUrlsLookup.cs | 1 - src/OpenSearch.Client/Descriptors.Cat.cs | 39 -------- src/OpenSearch.Client/OpenSearchClient.Cat.cs | 24 ----- src/OpenSearch.Client/Requests.Cat.cs | 77 --------------- .../_Generated/ApiUrlsLookup.cs | 3 + .../_Generated/Descriptors.Cat.cs | 68 ++++++++++++++ .../_Generated/OpenSearchClient.Cat.cs | 41 ++++++++ .../_Generated/Requests.Cat.cs | 94 +++++++++++++++++++ .../RequestParameters.Cat.cs | 52 ---------- .../OpenSearchLowLevelClient.Cat.cs | 20 ---- .../RequestParameters.Cat.cs | 72 ++++++++++++++ .../OpenSearchLowLevelClient.Cat.cs | 55 +++++++++++ 13 files changed, 334 insertions(+), 213 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index e8742c710e..c48e8b3e48 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -57,6 +57,7 @@ public static class CodeConfiguration new("cat.plugins"), new("cat.recovery"), new("cat.repositories"), + new("cat.segments"), new("cluster.*"), new("dangling_indices.*"), diff --git a/src/OpenSearch.Client/ApiUrlsLookup.cs b/src/OpenSearch.Client/ApiUrlsLookup.cs index faad2b7f24..5186ac404b 100644 --- a/src/OpenSearch.Client/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/ApiUrlsLookup.cs @@ -46,7 +46,6 @@ namespace OpenSearch.Client internal static partial class ApiUrlsLookups { internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[]{"_bulk", "{index}/_bulk"}); - internal static ApiUrls CatSegments = new ApiUrls(new[]{"_cat/segments", "_cat/segments/{index}"}); internal static ApiUrls CatShards = new ApiUrls(new[]{"_cat/shards", "_cat/shards/{index}"}); internal static ApiUrls CatSnapshots = new ApiUrls(new[]{"_cat/snapshots", "_cat/snapshots/{repository}"}); internal static ApiUrls CatTasks = new ApiUrls(new[]{"_cat/tasks"}); diff --git a/src/OpenSearch.Client/Descriptors.Cat.cs b/src/OpenSearch.Client/Descriptors.Cat.cs index 562ddc0151..0a53ac002a 100644 --- a/src/OpenSearch.Client/Descriptors.Cat.cs +++ b/src/OpenSearch.Client/Descriptors.Cat.cs @@ -57,45 +57,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - ///Descriptor for Segments https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - public partial class CatSegmentsDescriptor : RequestDescriptorBase, ICatSegmentsRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatSegments; - ////_cat/segments - public CatSegmentsDescriptor(): base() - { - } - - ////_cat/segments/{index} - ///Optional, accepts null - public CatSegmentsDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Indices ICatSegmentsRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of index names to limit the returned information - public CatSegmentsDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public CatSegmentsDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public CatSegmentsDescriptor AllIndices() => Index(Indices.All); - // Request parameters - ///The unit in which to display byte values - public CatSegmentsDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes); - ///a short version of the Accept header, e.g. json, yaml - public CatSegmentsDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatSegmentsDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatSegmentsDescriptor Help(bool? help = true) => Qs("help", help); - ///Comma-separated list of column names or column aliases to sort by - public CatSegmentsDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatSegmentsDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - ///Descriptor for Shards https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ public partial class CatShardsDescriptor : RequestDescriptorBase, ICatShardsRequest { diff --git a/src/OpenSearch.Client/OpenSearchClient.Cat.cs b/src/OpenSearch.Client/OpenSearchClient.Cat.cs index 36496ffcf1..f18374443a 100644 --- a/src/OpenSearch.Client/OpenSearchClient.Cat.cs +++ b/src/OpenSearch.Client/OpenSearchClient.Cat.cs @@ -59,30 +59,6 @@ namespace OpenSearch.Client.Specification.CatApi /// public partial class CatNamespace : NamespacedClientProxy { - /// - /// GET request to the cat.segments API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - /// - public CatResponse Segments(Func selector = null) => Segments(selector.InvokeOrDefault(new CatSegmentsDescriptor())); - /// - /// GET request to the cat.segments API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - /// - public Task> SegmentsAsync(Func selector = null, CancellationToken ct = default) => SegmentsAsync(selector.InvokeOrDefault(new CatSegmentsDescriptor()), ct); - /// - /// GET request to the cat.segments API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - /// - public CatResponse Segments(ICatSegmentsRequest request) => DoCat(request); - /// - /// GET request to the cat.segments API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - /// - public Task> SegmentsAsync(ICatSegmentsRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); /// /// GET request to the cat.shards API, read more about this API online: /// diff --git a/src/OpenSearch.Client/Requests.Cat.cs b/src/OpenSearch.Client/Requests.Cat.cs index 9e7e91ade3..4964541ccb 100644 --- a/src/OpenSearch.Client/Requests.Cat.cs +++ b/src/OpenSearch.Client/Requests.Cat.cs @@ -58,83 +58,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - [InterfaceDataContract] - public partial interface ICatSegmentsRequest : IRequest - { - [IgnoreDataMember] - Indices Index - { - get; - } - } - - ///Request for Segments https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - public partial class CatSegmentsRequest : PlainRequestBase, ICatSegmentsRequest - { - protected ICatSegmentsRequest Self => this; - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatSegments; - ////_cat/segments - public CatSegmentsRequest(): base() - { - } - - ////_cat/segments/{index} - ///Optional, accepts null - public CatSegmentsRequest(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - [IgnoreDataMember] - Indices ICatSegmentsRequest.Index => Self.RouteValues.Get("index"); - // Request parameters - ///The unit in which to display byte values - public Bytes? Bytes - { - get => Q("bytes"); - set => Q("bytes", value); - } - - ///a short version of the Accept header, e.g. json, yaml - public string Format - { - get => Q("format"); - set - { - Q("format", value); - SetAcceptHeader(value); - } - } - - ///Comma-separated list of column names to display - public string[] Headers - { - get => Q("h"); - set => Q("h", value); - } - - ///Return help information - public bool? Help - { - get => Q("help"); - set => Q("help", value); - } - - ///Comma-separated list of column names or column aliases to sort by - public string[] SortByColumns - { - get => Q("s"); - set => Q("s", value); - } - - ///Verbose mode. Display column headers - public bool? Verbose - { - get => Q("v"); - set => Q("v", value); - } - } - [InterfaceDataContract] public partial interface ICatShardsRequest : IRequest { diff --git a/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs b/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs index 77b97c73aa..704478e372 100644 --- a/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs @@ -81,6 +81,9 @@ internal static partial class ApiUrlsLookups internal static readonly ApiUrls CatRepositories = new(new[] { "_cat/repositories" }); + internal static readonly ApiUrls CatSegments = + new(new[] { "_cat/segments", "_cat/segments/{index}" }); + internal static readonly ApiUrls ClusterAllocationExplain = new(new[] { "_cluster/allocation/explain" }); diff --git a/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs b/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs index 3f9ef2529e..4e2c341b28 100644 --- a/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs +++ b/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs @@ -783,4 +783,72 @@ public CatRepositoriesDescriptor SortByColumns(params string[] sortbycolumns) => /// Verbose mode. Display column headers. public CatRepositoriesDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); } + + /// Descriptor for Segments https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ + public partial class CatSegmentsDescriptor + : RequestDescriptorBase< + CatSegmentsDescriptor, + CatSegmentsRequestParameters, + ICatSegmentsRequest + >, + ICatSegmentsRequest + { + internal override ApiUrls ApiUrls => ApiUrlsLookups.CatSegments; + + /// /_cat/segments + public CatSegmentsDescriptor() + : base() { } + + /// /_cat/segments/{index} + /// Optional, accepts null + public CatSegmentsDescriptor(Indices index) + : base(r => r.Optional("index", index)) { } + + // values part of the url path + Indices ICatSegmentsRequest.Index => Self.RouteValues.Get("index"); + + /// Comma-separated list of indices to limit the returned information. + public CatSegmentsDescriptor Index(Indices index) => + Assign(index, (a, v) => a.RouteValues.Optional("index", v)); + + /// a shortcut into calling Index(typeof(TOther)) + public CatSegmentsDescriptor Index() + where TOther : class => + Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); + + /// A shortcut into calling Index(Indices.All) + public CatSegmentsDescriptor AllIndices() => Index(Indices.All); + + // Request parameters + /// The unit in which to display byte values. + public CatSegmentsDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes); + + /// Operation timeout for connection to cluster-manager node. + /// Supported by OpenSearch servers of version 2.0.0 or greater. + public CatSegmentsDescriptor ClusterManagerTimeout(Time clustermanagertimeout) => + Qs("cluster_manager_timeout", clustermanagertimeout); + + /// A short version of the Accept header, e.g. json, yaml. + public CatSegmentsDescriptor Format(string format) => Qs("format", format); + + /// Comma-separated list of column names to display. + public CatSegmentsDescriptor Headers(params string[] headers) => Qs("h", headers); + + /// Return help information. + public CatSegmentsDescriptor Help(bool? help = true) => Qs("help", help); + + /// Operation timeout for connection to master node. + [Obsolete( + "Deprecated as of: 2.0.0, reason: To promote inclusive language, use 'cluster_manager_timeout' instead." + )] + public CatSegmentsDescriptor MasterTimeout(Time mastertimeout) => + Qs("master_timeout", mastertimeout); + + /// Comma-separated list of column names or column aliases to sort by. + public CatSegmentsDescriptor SortByColumns(params string[] sortbycolumns) => + Qs("s", sortbycolumns); + + /// Verbose mode. Display column headers. + public CatSegmentsDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); + } } diff --git a/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs b/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs index a65f8f8d77..917baca60c 100644 --- a/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs +++ b/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs @@ -696,5 +696,46 @@ public Task> RepositoriesAsync( CatRepositoriesRequestParameters, CatRepositoriesRecord >(request, ct); + + /// + /// GET request to the cat.segments API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ + /// + public CatResponse Segments( + Func selector = null + ) => Segments(selector.InvokeOrDefault(new CatSegmentsDescriptor())); + + /// + /// GET request to the cat.segments API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ + /// + public Task> SegmentsAsync( + Func selector = null, + CancellationToken ct = default + ) => SegmentsAsync(selector.InvokeOrDefault(new CatSegmentsDescriptor()), ct); + + /// + /// GET request to the cat.segments API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ + /// + public CatResponse Segments(ICatSegmentsRequest request) => + DoCat(request); + + /// + /// GET request to the cat.segments API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ + /// + public Task> SegmentsAsync( + ICatSegmentsRequest request, + CancellationToken ct = default + ) => + DoCatAsync( + request, + ct + ); } } diff --git a/src/OpenSearch.Client/_Generated/Requests.Cat.cs b/src/OpenSearch.Client/_Generated/Requests.Cat.cs index f7bbc04fdf..d3da1725f2 100644 --- a/src/OpenSearch.Client/_Generated/Requests.Cat.cs +++ b/src/OpenSearch.Client/_Generated/Requests.Cat.cs @@ -1269,4 +1269,98 @@ public bool? Verbose set => Q("v", value); } } + + [InterfaceDataContract] + public partial interface ICatSegmentsRequest : IRequest + { + [IgnoreDataMember] + Indices Index { get; } + } + + /// Request for Segments https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ + public partial class CatSegmentsRequest + : PlainRequestBase, + ICatSegmentsRequest + { + protected ICatSegmentsRequest Self => this; + internal override ApiUrls ApiUrls => ApiUrlsLookups.CatSegments; + + /// /_cat/segments + public CatSegmentsRequest() + : base() { } + + /// /_cat/segments/{index} + /// Optional, accepts null + public CatSegmentsRequest(Indices index) + : base(r => r.Optional("index", index)) { } + + // values part of the url path + [IgnoreDataMember] + Indices ICatSegmentsRequest.Index => Self.RouteValues.Get("index"); + + // Request parameters + /// The unit in which to display byte values. + public Bytes? Bytes + { + get => Q("bytes"); + set => Q("bytes", value); + } + + /// Operation timeout for connection to cluster-manager node. + /// Supported by OpenSearch servers of version 2.0.0 or greater. + public Time ClusterManagerTimeout + { + get => Q public partial class LowLevelCatNamespace : NamespacedClientProxy { - ///GET on /_cat/segments https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - public TResponse Segments(CatSegmentsRequestParameters requestParameters = null) - where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, "_cat/segments", null, RequestParams(requestParameters)); - ///GET on /_cat/segments https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - [MapsApi("cat.segments", "")] - public Task SegmentsAsync(CatSegmentsRequestParameters requestParameters = null, CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, "_cat/segments", ctx, null, RequestParams(requestParameters)); - ///GET on /_cat/segments/{index} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - ///A comma-separated list of index names to limit the returned information - ///Request specific configuration such as querystring parameters & request specific connection settings. - public TResponse Segments(string index, CatSegmentsRequestParameters requestParameters = null) - where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, Url($"_cat/segments/{index:index}"), null, RequestParams(requestParameters)); - ///GET on /_cat/segments/{index} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - ///A comma-separated list of index names to limit the returned information - ///Request specific configuration such as querystring parameters & request specific connection settings. - [MapsApi("cat.segments", "index")] - public Task SegmentsAsync(string index, CatSegmentsRequestParameters requestParameters = null, CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, Url($"_cat/segments/{index:index}"), ctx, null, RequestParams(requestParameters)); ///GET on /_cat/shards https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ ///Request specific configuration such as querystring parameters & request specific connection settings. public TResponse Shards(CatShardsRequestParameters requestParameters = null) diff --git a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs index b762f50e1e..598eb44c32 100644 --- a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs +++ b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs @@ -1073,4 +1073,76 @@ public bool? Verbose set => Q("v", value); } } + + /// Request options for Segments https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ + public partial class CatSegmentsRequestParameters + : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.GET; + public override bool SupportsBody => false; + + /// The unit in which to display byte values. + public Bytes? Bytes + { + get => Q("bytes"); + set => Q("bytes", value); + } + + /// Operation timeout for connection to cluster-manager node. + /// Supported by OpenSearch servers of version 2.0.0 or greater. + public TimeSpan ClusterManagerTimeout + { + get => Q("cluster_manager_timeout"); + set => Q("cluster_manager_timeout", value); + } + + /// A short version of the Accept header, e.g. json, yaml. + public string Format + { + get => Q("format"); + set + { + Q("format", value); + SetAcceptHeader(value); + } + } + + /// Comma-separated list of column names to display. + public string[] Headers + { + get => Q("h"); + set => Q("h", value); + } + + /// Return help information. + public bool? Help + { + get => Q("help"); + set => Q("help", value); + } + + /// Operation timeout for connection to master node. + [Obsolete( + "Deprecated as of: 2.0.0, reason: To promote inclusive language, use 'cluster_manager_timeout' instead." + )] + public TimeSpan MasterTimeout + { + get => Q("master_timeout"); + set => Q("master_timeout", value); + } + + /// Comma-separated list of column names or column aliases to sort by. + public string[] SortByColumns + { + get => Q("s"); + set => Q("s", value); + } + + /// Verbose mode. Display column headers. + public bool? Verbose + { + get => Q("v"); + set => Q("v", value); + } + } } diff --git a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs index d02b9247ea..de7b067741 100644 --- a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs +++ b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs @@ -617,5 +617,60 @@ public Task RepositoriesAsync( null, RequestParams(requestParameters) ); + + /// GET on /_cat/segments https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + public TResponse Segments(CatSegmentsRequestParameters requestParameters = null) + where TResponse : class, IOpenSearchResponse, new() => + DoRequest(GET, "_cat/segments", null, RequestParams(requestParameters)); + + /// GET on /_cat/segments https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + [MapsApi("cat.segments", "")] + public Task SegmentsAsync( + CatSegmentsRequestParameters requestParameters = null, + CancellationToken ctx = default + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequestAsync( + GET, + "_cat/segments", + ctx, + null, + RequestParams(requestParameters) + ); + + /// GET on /_cat/segments/{index} https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ + /// Comma-separated list of indices to limit the returned information. + /// Request specific configuration such as querystring parameters & request specific connection settings. + public TResponse Segments( + string index, + CatSegmentsRequestParameters requestParameters = null + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequest( + GET, + Url($"_cat/segments/{index:index}"), + null, + RequestParams(requestParameters) + ); + + /// GET on /_cat/segments/{index} https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ + /// Comma-separated list of indices to limit the returned information. + /// Request specific configuration such as querystring parameters & request specific connection settings. + [MapsApi("cat.segments", "index")] + public Task SegmentsAsync( + string index, + CatSegmentsRequestParameters requestParameters = null, + CancellationToken ctx = default + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequestAsync( + GET, + Url($"_cat/segments/{index:index}"), + ctx, + null, + RequestParams(requestParameters) + ); } } From adc15bf8808f89c028fa2621a2b786ee2ef38b4d Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 18 Jan 2024 16:57:20 +1300 Subject: [PATCH 5/9] Re-generate cat.shards Signed-off-by: Thomas Farr --- .../Configuration/CodeConfiguration.cs | 1 + src/OpenSearch.Client/ApiUrlsLookup.cs | 1 - src/OpenSearch.Client/Descriptors.Cat.cs | 47 -------- src/OpenSearch.Client/OpenSearchClient.Cat.cs | 24 ----- src/OpenSearch.Client/Requests.Cat.cs | 100 ----------------- .../_Generated/ApiUrlsLookup.cs | 3 + .../_Generated/Descriptors.Cat.cs | 67 ++++++++++++ .../_Generated/OpenSearchClient.Cat.cs | 38 +++++++ .../_Generated/Requests.Cat.cs | 101 ++++++++++++++++++ .../RequestParameters.Cat.cs | 75 ------------- .../OpenSearchLowLevelClient.Cat.cs | 20 ---- .../RequestParameters.Cat.cs | 78 ++++++++++++++ .../OpenSearchLowLevelClient.Cat.cs | 55 ++++++++++ 13 files changed, 343 insertions(+), 267 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index c48e8b3e48..1fc2780694 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -58,6 +58,7 @@ public static class CodeConfiguration new("cat.recovery"), new("cat.repositories"), new("cat.segments"), + new("cat.shards"), new("cluster.*"), new("dangling_indices.*"), diff --git a/src/OpenSearch.Client/ApiUrlsLookup.cs b/src/OpenSearch.Client/ApiUrlsLookup.cs index 5186ac404b..d0dce1ade4 100644 --- a/src/OpenSearch.Client/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/ApiUrlsLookup.cs @@ -46,7 +46,6 @@ namespace OpenSearch.Client internal static partial class ApiUrlsLookups { internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[]{"_bulk", "{index}/_bulk"}); - internal static ApiUrls CatShards = new ApiUrls(new[]{"_cat/shards", "_cat/shards/{index}"}); internal static ApiUrls CatSnapshots = new ApiUrls(new[]{"_cat/snapshots", "_cat/snapshots/{repository}"}); internal static ApiUrls CatTasks = new ApiUrls(new[]{"_cat/tasks"}); internal static ApiUrls CatTemplates = new ApiUrls(new[]{"_cat/templates", "_cat/templates/{name}"}); diff --git a/src/OpenSearch.Client/Descriptors.Cat.cs b/src/OpenSearch.Client/Descriptors.Cat.cs index 0a53ac002a..3ecd546549 100644 --- a/src/OpenSearch.Client/Descriptors.Cat.cs +++ b/src/OpenSearch.Client/Descriptors.Cat.cs @@ -57,53 +57,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - ///Descriptor for Shards https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - public partial class CatShardsDescriptor : RequestDescriptorBase, ICatShardsRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatShards; - ////_cat/shards - public CatShardsDescriptor(): base() - { - } - - ////_cat/shards/{index} - ///Optional, accepts null - public CatShardsDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Indices ICatShardsRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of index names to limit the returned information - public CatShardsDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public CatShardsDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public CatShardsDescriptor AllIndices() => Index(Indices.All); - // Request parameters - ///The unit in which to display byte values - public CatShardsDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes); - ///a short version of the Accept header, e.g. json, yaml - public CatShardsDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatShardsDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatShardsDescriptor Help(bool? help = true) => Qs("help", help); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public CatShardsDescriptor Local(bool? local = true) => Qs("local", local); - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CatShardsDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Explicit operation timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CatShardsDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Comma-separated list of column names or column aliases to sort by - public CatShardsDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatShardsDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - ///Descriptor for Snapshots https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ public partial class CatSnapshotsDescriptor : RequestDescriptorBase, ICatSnapshotsRequest { diff --git a/src/OpenSearch.Client/OpenSearchClient.Cat.cs b/src/OpenSearch.Client/OpenSearchClient.Cat.cs index f18374443a..1ea7167f8d 100644 --- a/src/OpenSearch.Client/OpenSearchClient.Cat.cs +++ b/src/OpenSearch.Client/OpenSearchClient.Cat.cs @@ -59,30 +59,6 @@ namespace OpenSearch.Client.Specification.CatApi /// public partial class CatNamespace : NamespacedClientProxy { - /// - /// GET request to the cat.shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - /// - public CatResponse Shards(Func selector = null) => Shards(selector.InvokeOrDefault(new CatShardsDescriptor())); - /// - /// GET request to the cat.shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - /// - public Task> ShardsAsync(Func selector = null, CancellationToken ct = default) => ShardsAsync(selector.InvokeOrDefault(new CatShardsDescriptor()), ct); - /// - /// GET request to the cat.shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - /// - public CatResponse Shards(ICatShardsRequest request) => DoCat(request); - /// - /// GET request to the cat.shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - /// - public Task> ShardsAsync(ICatShardsRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); /// /// GET request to the cat.snapshots API, read more about this API online: /// diff --git a/src/OpenSearch.Client/Requests.Cat.cs b/src/OpenSearch.Client/Requests.Cat.cs index 4964541ccb..49bc2376d4 100644 --- a/src/OpenSearch.Client/Requests.Cat.cs +++ b/src/OpenSearch.Client/Requests.Cat.cs @@ -58,106 +58,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - [InterfaceDataContract] - public partial interface ICatShardsRequest : IRequest - { - [IgnoreDataMember] - Indices Index - { - get; - } - } - - ///Request for Shards https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - public partial class CatShardsRequest : PlainRequestBase, ICatShardsRequest - { - protected ICatShardsRequest Self => this; - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatShards; - ////_cat/shards - public CatShardsRequest(): base() - { - } - - ////_cat/shards/{index} - ///Optional, accepts null - public CatShardsRequest(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - [IgnoreDataMember] - Indices ICatShardsRequest.Index => Self.RouteValues.Get("index"); - // Request parameters - ///The unit in which to display byte values - public Bytes? Bytes - { - get => Q("bytes"); - set => Q("bytes", value); - } - - ///a short version of the Accept header, e.g. json, yaml - public string Format - { - get => Q("format"); - set - { - Q("format", value); - SetAcceptHeader(value); - } - } - - ///Comma-separated list of column names to display - public string[] Headers - { - get => Q("h"); - set => Q("h", value); - } - - ///Return help information - public bool? Help - { - get => Q("help"); - set => Q("help", value); - } - - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public bool? Local - { - get => Q("local"); - set => Q("local", value); - } - - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public Time MasterTimeout - { - get => Q public partial class LowLevelCatNamespace : NamespacedClientProxy { - ///GET on /_cat/shards https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - public TResponse Shards(CatShardsRequestParameters requestParameters = null) - where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, "_cat/shards", null, RequestParams(requestParameters)); - ///GET on /_cat/shards https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - [MapsApi("cat.shards", "")] - public Task ShardsAsync(CatShardsRequestParameters requestParameters = null, CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, "_cat/shards", ctx, null, RequestParams(requestParameters)); - ///GET on /_cat/shards/{index} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - ///A comma-separated list of index names to limit the returned information - ///Request specific configuration such as querystring parameters & request specific connection settings. - public TResponse Shards(string index, CatShardsRequestParameters requestParameters = null) - where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, Url($"_cat/shards/{index:index}"), null, RequestParams(requestParameters)); - ///GET on /_cat/shards/{index} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/ - ///A comma-separated list of index names to limit the returned information - ///Request specific configuration such as querystring parameters & request specific connection settings. - [MapsApi("cat.shards", "index")] - public Task ShardsAsync(string index, CatShardsRequestParameters requestParameters = null, CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, Url($"_cat/shards/{index:index}"), ctx, null, RequestParams(requestParameters)); ///GET on /_cat/snapshots https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ ///Request specific configuration such as querystring parameters & request specific connection settings. public TResponse Snapshots(CatSnapshotsRequestParameters requestParameters = null) diff --git a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs index 598eb44c32..77fb6bff40 100644 --- a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs +++ b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs @@ -1145,4 +1145,82 @@ public bool? Verbose set => Q("v", value); } } + + /// Request options for Shards https://opensearch.org/docs/latest/api-reference/cat/cat-shards/ + public partial class CatShardsRequestParameters : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.GET; + public override bool SupportsBody => false; + + /// The unit in which to display byte values. + public Bytes? Bytes + { + get => Q("bytes"); + set => Q("bytes", value); + } + + /// Operation timeout for connection to cluster-manager node. + /// Supported by OpenSearch servers of version 2.0.0 or greater. + public TimeSpan ClusterManagerTimeout + { + get => Q("cluster_manager_timeout"); + set => Q("cluster_manager_timeout", value); + } + + /// A short version of the Accept header, e.g. json, yaml. + public string Format + { + get => Q("format"); + set + { + Q("format", value); + SetAcceptHeader(value); + } + } + + /// Comma-separated list of column names to display. + public string[] Headers + { + get => Q("h"); + set => Q("h", value); + } + + /// Return help information. + public bool? Help + { + get => Q("help"); + set => Q("help", value); + } + + /// Return local information, do not retrieve the state from cluster-manager node. + public bool? Local + { + get => Q("local"); + set => Q("local", value); + } + + /// Operation timeout for connection to master node. + [Obsolete( + "Deprecated as of: 2.0.0, reason: To promote inclusive language, use 'cluster_manager_timeout' instead." + )] + public TimeSpan MasterTimeout + { + get => Q("master_timeout"); + set => Q("master_timeout", value); + } + + /// Comma-separated list of column names or column aliases to sort by. + public string[] SortByColumns + { + get => Q("s"); + set => Q("s", value); + } + + /// Verbose mode. Display column headers. + public bool? Verbose + { + get => Q("v"); + set => Q("v", value); + } + } } diff --git a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs index de7b067741..6a340fb4b9 100644 --- a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs +++ b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs @@ -672,5 +672,60 @@ public Task SegmentsAsync( null, RequestParams(requestParameters) ); + + /// GET on /_cat/shards https://opensearch.org/docs/latest/api-reference/cat/cat-shards/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + public TResponse Shards(CatShardsRequestParameters requestParameters = null) + where TResponse : class, IOpenSearchResponse, new() => + DoRequest(GET, "_cat/shards", null, RequestParams(requestParameters)); + + /// GET on /_cat/shards https://opensearch.org/docs/latest/api-reference/cat/cat-shards/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + [MapsApi("cat.shards", "")] + public Task ShardsAsync( + CatShardsRequestParameters requestParameters = null, + CancellationToken ctx = default + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequestAsync( + GET, + "_cat/shards", + ctx, + null, + RequestParams(requestParameters) + ); + + /// GET on /_cat/shards/{index} https://opensearch.org/docs/latest/api-reference/cat/cat-shards/ + /// Comma-separated list of indices to limit the returned information. + /// Request specific configuration such as querystring parameters & request specific connection settings. + public TResponse Shards( + string index, + CatShardsRequestParameters requestParameters = null + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequest( + GET, + Url($"_cat/shards/{index:index}"), + null, + RequestParams(requestParameters) + ); + + /// GET on /_cat/shards/{index} https://opensearch.org/docs/latest/api-reference/cat/cat-shards/ + /// Comma-separated list of indices to limit the returned information. + /// Request specific configuration such as querystring parameters & request specific connection settings. + [MapsApi("cat.shards", "index")] + public Task ShardsAsync( + string index, + CatShardsRequestParameters requestParameters = null, + CancellationToken ctx = default + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequestAsync( + GET, + Url($"_cat/shards/{index:index}"), + ctx, + null, + RequestParams(requestParameters) + ); } } From 918e1db043e885778ac72493adef11d6908d04dd Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 18 Jan 2024 17:05:04 +1300 Subject: [PATCH 6/9] Re-generate cat.snapshots Signed-off-by: Thomas Farr --- .../Configuration/CodeConfiguration.cs | 1 + src/OpenSearch.Client/ApiUrlsLookup.cs | 1 - src/OpenSearch.Client/Descriptors.Cat.cs | 40 -------- src/OpenSearch.Client/OpenSearchClient.Cat.cs | 24 ----- src/OpenSearch.Client/Requests.Cat.cs | 93 ------------------ .../_Generated/ApiUrlsLookup.cs | 3 + .../_Generated/Descriptors.Cat.cs | 61 ++++++++++++ .../_Generated/OpenSearchClient.Cat.cs | 41 ++++++++ .../_Generated/Requests.Cat.cs | 94 +++++++++++++++++++ .../RequestParameters.Cat.cs | 68 -------------- .../OpenSearchLowLevelClient.Cat.cs | 20 ---- .../RequestParameters.Cat.cs | 72 ++++++++++++++ .../OpenSearchLowLevelClient.Cat.cs | 57 +++++++++++ 13 files changed, 329 insertions(+), 246 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 1fc2780694..e129d6cba2 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -59,6 +59,7 @@ public static class CodeConfiguration new("cat.repositories"), new("cat.segments"), new("cat.shards"), + new("cat.snapshots"), new("cluster.*"), new("dangling_indices.*"), diff --git a/src/OpenSearch.Client/ApiUrlsLookup.cs b/src/OpenSearch.Client/ApiUrlsLookup.cs index d0dce1ade4..6a472c5e90 100644 --- a/src/OpenSearch.Client/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/ApiUrlsLookup.cs @@ -46,7 +46,6 @@ namespace OpenSearch.Client internal static partial class ApiUrlsLookups { internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[]{"_bulk", "{index}/_bulk"}); - internal static ApiUrls CatSnapshots = new ApiUrls(new[]{"_cat/snapshots", "_cat/snapshots/{repository}"}); internal static ApiUrls CatTasks = new ApiUrls(new[]{"_cat/tasks"}); internal static ApiUrls CatTemplates = new ApiUrls(new[]{"_cat/templates", "_cat/templates/{name}"}); internal static ApiUrls CatThreadPool = new ApiUrls(new[]{"_cat/thread_pool", "_cat/thread_pool/{thread_pool_patterns}"}); diff --git a/src/OpenSearch.Client/Descriptors.Cat.cs b/src/OpenSearch.Client/Descriptors.Cat.cs index 3ecd546549..13234b0993 100644 --- a/src/OpenSearch.Client/Descriptors.Cat.cs +++ b/src/OpenSearch.Client/Descriptors.Cat.cs @@ -57,46 +57,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - ///Descriptor for Snapshots https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - public partial class CatSnapshotsDescriptor : RequestDescriptorBase, ICatSnapshotsRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatSnapshots; - ////_cat/snapshots - public CatSnapshotsDescriptor(): base() - { - } - - ////_cat/snapshots/{repository} - ///Optional, accepts null - public CatSnapshotsDescriptor(Names repository): base(r => r.Optional("repository", repository)) - { - } - - // values part of the url path - Names ICatSnapshotsRequest.RepositoryName => Self.RouteValues.Get("repository"); - ///Name of repository from which to fetch the snapshot information - public CatSnapshotsDescriptor RepositoryName(Names repository) => Assign(repository, (a, v) => a.RouteValues.Optional("repository", v)); - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public CatSnapshotsDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatSnapshotsDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatSnapshotsDescriptor Help(bool? help = true) => Qs("help", help); - ///Set to true to ignore unavailable snapshots - public CatSnapshotsDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CatSnapshotsDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Explicit operation timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CatSnapshotsDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Comma-separated list of column names or column aliases to sort by - public CatSnapshotsDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatSnapshotsDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - ///Descriptor for Tasks https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ public partial class CatTasksDescriptor : RequestDescriptorBase, ICatTasksRequest { diff --git a/src/OpenSearch.Client/OpenSearchClient.Cat.cs b/src/OpenSearch.Client/OpenSearchClient.Cat.cs index 1ea7167f8d..c21a3a207c 100644 --- a/src/OpenSearch.Client/OpenSearchClient.Cat.cs +++ b/src/OpenSearch.Client/OpenSearchClient.Cat.cs @@ -59,30 +59,6 @@ namespace OpenSearch.Client.Specification.CatApi /// public partial class CatNamespace : NamespacedClientProxy { - /// - /// GET request to the cat.snapshots API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - /// - public CatResponse Snapshots(Func selector = null) => Snapshots(selector.InvokeOrDefault(new CatSnapshotsDescriptor())); - /// - /// GET request to the cat.snapshots API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - /// - public Task> SnapshotsAsync(Func selector = null, CancellationToken ct = default) => SnapshotsAsync(selector.InvokeOrDefault(new CatSnapshotsDescriptor()), ct); - /// - /// GET request to the cat.snapshots API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - /// - public CatResponse Snapshots(ICatSnapshotsRequest request) => DoCat(request); - /// - /// GET request to the cat.snapshots API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - /// - public Task> SnapshotsAsync(ICatSnapshotsRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); /// /// GET request to the cat.tasks API, read more about this API online: /// diff --git a/src/OpenSearch.Client/Requests.Cat.cs b/src/OpenSearch.Client/Requests.Cat.cs index 49bc2376d4..29a96d183f 100644 --- a/src/OpenSearch.Client/Requests.Cat.cs +++ b/src/OpenSearch.Client/Requests.Cat.cs @@ -58,99 +58,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - [InterfaceDataContract] - public partial interface ICatSnapshotsRequest : IRequest - { - [IgnoreDataMember] - Names RepositoryName - { - get; - } - } - - ///Request for Snapshots https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - public partial class CatSnapshotsRequest : PlainRequestBase, ICatSnapshotsRequest - { - protected ICatSnapshotsRequest Self => this; - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatSnapshots; - ////_cat/snapshots - public CatSnapshotsRequest(): base() - { - } - - ////_cat/snapshots/{repository} - ///Optional, accepts null - public CatSnapshotsRequest(Names repository): base(r => r.Optional("repository", repository)) - { - } - - // values part of the url path - [IgnoreDataMember] - Names ICatSnapshotsRequest.RepositoryName => Self.RouteValues.Get("repository"); - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public string Format - { - get => Q("format"); - set - { - Q("format", value); - SetAcceptHeader(value); - } - } - - ///Comma-separated list of column names to display - public string[] Headers - { - get => Q("h"); - set => Q("h", value); - } - - ///Return help information - public bool? Help - { - get => Q("help"); - set => Q("help", value); - } - - ///Set to true to ignore unavailable snapshots - public bool? IgnoreUnavailable - { - get => Q("ignore_unavailable"); - set => Q("ignore_unavailable", value); - } - - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public Time MasterTimeout - { - get => Q public partial class LowLevelCatNamespace : NamespacedClientProxy { - ///GET on /_cat/snapshots https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - public TResponse Snapshots(CatSnapshotsRequestParameters requestParameters = null) - where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, "_cat/snapshots", null, RequestParams(requestParameters)); - ///GET on /_cat/snapshots https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - [MapsApi("cat.snapshots", "")] - public Task SnapshotsAsync(CatSnapshotsRequestParameters requestParameters = null, CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, "_cat/snapshots", ctx, null, RequestParams(requestParameters)); - ///GET on /_cat/snapshots/{repository} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - ///Name of repository from which to fetch the snapshot information - ///Request specific configuration such as querystring parameters & request specific connection settings. - public TResponse Snapshots(string repository, CatSnapshotsRequestParameters requestParameters = null) - where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, Url($"_cat/snapshots/{repository:repository}"), null, RequestParams(requestParameters)); - ///GET on /_cat/snapshots/{repository} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/ - ///Name of repository from which to fetch the snapshot information - ///Request specific configuration such as querystring parameters & request specific connection settings. - [MapsApi("cat.snapshots", "repository")] - public Task SnapshotsAsync(string repository, CatSnapshotsRequestParameters requestParameters = null, CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, Url($"_cat/snapshots/{repository:repository}"), ctx, null, RequestParams(requestParameters)); ///GET on /_cat/tasks https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ ///Request specific configuration such as querystring parameters & request specific connection settings. ///Note: Experimental within the OpenSearch server, this functionality is Experimental and may be changed or removed completely in a future release. OpenSearch 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. diff --git a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs index 77fb6bff40..b78ff2e89b 100644 --- a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs +++ b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs @@ -1223,4 +1223,76 @@ public bool? Verbose set => Q("v", value); } } + + /// Request options for Snapshots https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/ + public partial class CatSnapshotsRequestParameters + : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.GET; + public override bool SupportsBody => false; + + /// Operation timeout for connection to cluster-manager node. + /// Supported by OpenSearch servers of version 2.0.0 or greater. + public TimeSpan ClusterManagerTimeout + { + get => Q("cluster_manager_timeout"); + set => Q("cluster_manager_timeout", value); + } + + /// A short version of the Accept header, e.g. json, yaml. + public string Format + { + get => Q("format"); + set + { + Q("format", value); + SetAcceptHeader(value); + } + } + + /// Comma-separated list of column names to display. + public string[] Headers + { + get => Q("h"); + set => Q("h", value); + } + + /// Return help information. + public bool? Help + { + get => Q("help"); + set => Q("help", 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); + } + + /// Operation timeout for connection to master node. + [Obsolete( + "Deprecated as of: 2.0.0, reason: To promote inclusive language, use 'cluster_manager_timeout' instead." + )] + public TimeSpan MasterTimeout + { + get => Q("master_timeout"); + set => Q("master_timeout", value); + } + + /// Comma-separated list of column names or column aliases to sort by. + public string[] SortByColumns + { + get => Q("s"); + set => Q("s", value); + } + + /// Verbose mode. Display column headers. + public bool? Verbose + { + get => Q("v"); + set => Q("v", value); + } + } } diff --git a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs index 6a340fb4b9..59658e946a 100644 --- a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs +++ b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs @@ -727,5 +727,62 @@ public Task ShardsAsync( null, RequestParams(requestParameters) ); + + /// GET on /_cat/snapshots https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + public TResponse Snapshots( + CatSnapshotsRequestParameters requestParameters = null + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequest(GET, "_cat/snapshots", null, RequestParams(requestParameters)); + + /// GET on /_cat/snapshots https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + [MapsApi("cat.snapshots", "")] + public Task SnapshotsAsync( + CatSnapshotsRequestParameters requestParameters = null, + CancellationToken ctx = default + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequestAsync( + GET, + "_cat/snapshots", + ctx, + null, + RequestParams(requestParameters) + ); + + /// GET on /_cat/snapshots/{repository} https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/ + /// Comma-separated list of repository names. + /// Request specific configuration such as querystring parameters & request specific connection settings. + public TResponse Snapshots( + string repository, + CatSnapshotsRequestParameters requestParameters = null + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequest( + GET, + Url($"_cat/snapshots/{repository:repository}"), + null, + RequestParams(requestParameters) + ); + + /// GET on /_cat/snapshots/{repository} https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/ + /// Comma-separated list of repository names. + /// Request specific configuration such as querystring parameters & request specific connection settings. + [MapsApi("cat.snapshots", "repository")] + public Task SnapshotsAsync( + string repository, + CatSnapshotsRequestParameters requestParameters = null, + CancellationToken ctx = default + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequestAsync( + GET, + Url($"_cat/snapshots/{repository:repository}"), + ctx, + null, + RequestParams(requestParameters) + ); } } From b439f54d3c88dc43441ab65b85888fc6de9920d6 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 18 Jan 2024 17:14:45 +1300 Subject: [PATCH 7/9] Re-generate cat.tasks Signed-off-by: Thomas Farr --- .../Configuration/CodeConfiguration.cs | 1 + src/OpenSearch.Client/ApiUrlsLookup.cs | 1 - src/OpenSearch.Client/Descriptors.Cat.cs | 26 ------ src/OpenSearch.Client/OpenSearchClient.Cat.cs | 24 ------ src/OpenSearch.Client/Requests.Cat.cs | 84 ------------------ .../_Generated/ApiUrlsLookup.cs | 2 + .../_Generated/Descriptors.Cat.cs | 39 +++++++++ .../_Generated/OpenSearchClient.Cat.cs | 37 ++++++++ .../_Generated/Requests.Cat.cs | 85 +++++++++++++++++++ .../RequestParameters.Cat.cs | 76 ----------------- .../OpenSearchLowLevelClient.Cat.cs | 11 --- .../RequestParameters.Cat.cs | 77 +++++++++++++++++ .../OpenSearchLowLevelClient.Cat.cs | 22 +++++ 13 files changed, 263 insertions(+), 222 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index e129d6cba2..58e2926417 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -60,6 +60,7 @@ public static class CodeConfiguration new("cat.segments"), new("cat.shards"), new("cat.snapshots"), + new("cat.tasks"), new("cluster.*"), new("dangling_indices.*"), diff --git a/src/OpenSearch.Client/ApiUrlsLookup.cs b/src/OpenSearch.Client/ApiUrlsLookup.cs index 6a472c5e90..94594be866 100644 --- a/src/OpenSearch.Client/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/ApiUrlsLookup.cs @@ -46,7 +46,6 @@ namespace OpenSearch.Client internal static partial class ApiUrlsLookups { internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[]{"_bulk", "{index}/_bulk"}); - internal static ApiUrls CatTasks = new ApiUrls(new[]{"_cat/tasks"}); internal static ApiUrls CatTemplates = new ApiUrls(new[]{"_cat/templates", "_cat/templates/{name}"}); internal static ApiUrls CatThreadPool = new ApiUrls(new[]{"_cat/thread_pool", "_cat/thread_pool/{thread_pool_patterns}"}); internal static ApiUrls NoNamespaceClearScroll = new ApiUrls(new[]{"_search/scroll"}); diff --git a/src/OpenSearch.Client/Descriptors.Cat.cs b/src/OpenSearch.Client/Descriptors.Cat.cs index 13234b0993..8f6bd1150d 100644 --- a/src/OpenSearch.Client/Descriptors.Cat.cs +++ b/src/OpenSearch.Client/Descriptors.Cat.cs @@ -57,32 +57,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - ///Descriptor for Tasks https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ - public partial class CatTasksDescriptor : RequestDescriptorBase, ICatTasksRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatTasks; - // values part of the url path - // Request parameters - ///A comma-separated list of actions that should be returned. Leave empty to return all. - public CatTasksDescriptor Actions(params string[] actions) => Qs("actions", actions); - ///Return detailed task information (default: false) - public CatTasksDescriptor Detailed(bool? detailed = true) => Qs("detailed", detailed); - ///a short version of the Accept header, e.g. json, yaml - public CatTasksDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatTasksDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatTasksDescriptor Help(bool? help = true) => Qs("help", help); - ///A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - public CatTasksDescriptor Nodes(params string[] nodes) => Qs("nodes", nodes); - ///Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - public CatTasksDescriptor ParentTaskId(string parenttaskid) => Qs("parent_task_id", parenttaskid); - ///Comma-separated list of column names or column aliases to sort by - public CatTasksDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatTasksDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - ///Descriptor for Templates https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ public partial class CatTemplatesDescriptor : RequestDescriptorBase, ICatTemplatesRequest { diff --git a/src/OpenSearch.Client/OpenSearchClient.Cat.cs b/src/OpenSearch.Client/OpenSearchClient.Cat.cs index c21a3a207c..375c7dd0f3 100644 --- a/src/OpenSearch.Client/OpenSearchClient.Cat.cs +++ b/src/OpenSearch.Client/OpenSearchClient.Cat.cs @@ -59,30 +59,6 @@ namespace OpenSearch.Client.Specification.CatApi /// public partial class CatNamespace : NamespacedClientProxy { - /// - /// GET request to the cat.tasks API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ - /// - public CatResponse Tasks(Func selector = null) => Tasks(selector.InvokeOrDefault(new CatTasksDescriptor())); - /// - /// GET request to the cat.tasks API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ - /// - public Task> TasksAsync(Func selector = null, CancellationToken ct = default) => TasksAsync(selector.InvokeOrDefault(new CatTasksDescriptor()), ct); - /// - /// GET request to the cat.tasks API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ - /// - public CatResponse Tasks(ICatTasksRequest request) => DoCat(request); - /// - /// GET request to the cat.tasks API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ - /// - public Task> TasksAsync(ICatTasksRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); /// /// GET request to the cat.templates API, read more about this API online: /// diff --git a/src/OpenSearch.Client/Requests.Cat.cs b/src/OpenSearch.Client/Requests.Cat.cs index 29a96d183f..7733e72630 100644 --- a/src/OpenSearch.Client/Requests.Cat.cs +++ b/src/OpenSearch.Client/Requests.Cat.cs @@ -58,90 +58,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - [InterfaceDataContract] - public partial interface ICatTasksRequest : IRequest - { - } - - ///Request for Tasks https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ - ///Note: Experimental within the OpenSearch server, this functionality is experimental and may be changed or removed completely in a future release. OpenSearch will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features. - public partial class CatTasksRequest : PlainRequestBase, ICatTasksRequest - { - protected ICatTasksRequest Self => this; - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatTasks; - // values part of the url path - // Request parameters - ///A comma-separated list of actions that should be returned. Leave empty to return all. - public string[] Actions - { - get => Q("actions"); - set => Q("actions", value); - } - - ///Return detailed task information (default: false) - public bool? Detailed - { - get => Q("detailed"); - set => Q("detailed", value); - } - - ///a short version of the Accept header, e.g. json, yaml - public string Format - { - get => Q("format"); - set - { - Q("format", value); - SetAcceptHeader(value); - } - } - - ///Comma-separated list of column names to display - public string[] Headers - { - get => Q("h"); - set => Q("h", value); - } - - ///Return help information - public bool? Help - { - get => Q("help"); - set => Q("help", value); - } - - /// - /// A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're - /// connecting to, leave empty to get information from all nodes - /// - public string[] Nodes - { - get => Q("nodes"); - set => Q("nodes", value); - } - - ///Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - public string ParentTaskId - { - get => Q("parent_task_id"); - set => Q("parent_task_id", value); - } - - ///Comma-separated list of column names or column aliases to sort by - public string[] SortByColumns - { - get => Q("s"); - set => Q("s", value); - } - - ///Verbose mode. Display column headers - public bool? Verbose - { - get => Q("v"); - set => Q("v", value); - } - } - [InterfaceDataContract] public partial interface ICatTemplatesRequest : IRequest { diff --git a/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs b/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs index 993726b05c..9d24bc74f2 100644 --- a/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs @@ -90,6 +90,8 @@ internal static partial class ApiUrlsLookups internal static readonly ApiUrls CatSnapshots = new(new[] { "_cat/snapshots", "_cat/snapshots/{repository}" }); + internal static readonly ApiUrls CatTasks = new(new[] { "_cat/tasks" }); + internal static readonly ApiUrls ClusterAllocationExplain = new(new[] { "_cluster/allocation/explain" }); diff --git a/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs b/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs index 200ae02e96..7571aad0b8 100644 --- a/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs +++ b/src/OpenSearch.Client/_Generated/Descriptors.Cat.cs @@ -979,4 +979,43 @@ public CatSnapshotsDescriptor SortByColumns(params string[] sortbycolumns) => /// Verbose mode. Display column headers. public CatSnapshotsDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); } + + /// Descriptor for Tasks https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/ + public partial class CatTasksDescriptor + : RequestDescriptorBase, + ICatTasksRequest + { + internal override ApiUrls ApiUrls => ApiUrlsLookups.CatTasks; + + // values part of the url path + // Request parameters + /// Comma-separated list of actions that should be returned. Leave empty to return all. + public CatTasksDescriptor Actions(params string[] actions) => Qs("actions", actions); + + /// Return detailed task information. + public CatTasksDescriptor Detailed(bool? detailed = true) => Qs("detailed", detailed); + + /// A short version of the Accept header, e.g. json, yaml. + public CatTasksDescriptor Format(string format) => Qs("format", format); + + /// Comma-separated list of column names to display. + public CatTasksDescriptor Headers(params string[] headers) => Qs("h", headers); + + /// Return help information. + public CatTasksDescriptor Help(bool? help = true) => Qs("help", help); + + /// Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. + public CatTasksDescriptor Nodes(params string[] nodes) => Qs("nodes", nodes); + + /// Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. + public CatTasksDescriptor ParentTaskId(string parenttaskid) => + Qs("parent_task_id", parenttaskid); + + /// Comma-separated list of column names or column aliases to sort by. + public CatTasksDescriptor SortByColumns(params string[] sortbycolumns) => + Qs("s", sortbycolumns); + + /// Verbose mode. Display column headers. + public CatTasksDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); + } } diff --git a/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs b/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs index c9ae4774ad..bc3434ec40 100644 --- a/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs +++ b/src/OpenSearch.Client/_Generated/OpenSearchClient.Cat.cs @@ -816,5 +816,42 @@ public Task> SnapshotsAsync( request, ct ); + + /// + /// GET request to the cat.tasks API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/ + /// + public CatResponse Tasks( + Func selector = null + ) => Tasks(selector.InvokeOrDefault(new CatTasksDescriptor())); + + /// + /// GET request to the cat.tasks API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/ + /// + public Task> TasksAsync( + Func selector = null, + CancellationToken ct = default + ) => TasksAsync(selector.InvokeOrDefault(new CatTasksDescriptor()), ct); + + /// + /// GET request to the cat.tasks API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/ + /// + public CatResponse Tasks(ICatTasksRequest request) => + DoCat(request); + + /// + /// GET request to the cat.tasks API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/ + /// + public Task> TasksAsync( + ICatTasksRequest request, + CancellationToken ct = default + ) => DoCatAsync(request, ct); } } diff --git a/src/OpenSearch.Client/_Generated/Requests.Cat.cs b/src/OpenSearch.Client/_Generated/Requests.Cat.cs index 277b989c49..954d362d65 100644 --- a/src/OpenSearch.Client/_Generated/Requests.Cat.cs +++ b/src/OpenSearch.Client/_Generated/Requests.Cat.cs @@ -1558,4 +1558,89 @@ public bool? Verbose set => Q("v", value); } } + + [InterfaceDataContract] + public partial interface ICatTasksRequest : IRequest { } + + /// Request for Tasks https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/ + public partial class CatTasksRequest + : PlainRequestBase, + ICatTasksRequest + { + protected ICatTasksRequest Self => this; + internal override ApiUrls ApiUrls => ApiUrlsLookups.CatTasks; + + // values part of the url path + + // Request parameters + /// Comma-separated list of actions that should be returned. Leave empty to return all. + public string[] Actions + { + get => Q("actions"); + set => Q("actions", value); + } + + /// Return detailed task information. + public bool? Detailed + { + get => Q("detailed"); + set => Q("detailed", value); + } + + /// A short version of the Accept header, e.g. json, yaml. + public string Format + { + get => Q("format"); + set + { + Q("format", value); + SetAcceptHeader(value); + } + } + + /// Comma-separated list of column names to display. + public string[] Headers + { + get => Q("h"); + set => Q("h", value); + } + + /// Return help information. + public bool? Help + { + get => Q("help"); + set => Q("help", value); + } + + /// + /// Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're + /// connecting to, leave empty to get information from all nodes. + /// + public string[] Nodes + { + get => Q("nodes"); + set => Q("nodes", value); + } + + /// Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. + public string ParentTaskId + { + get => Q("parent_task_id"); + set => Q("parent_task_id", value); + } + + /// Comma-separated list of column names or column aliases to sort by. + public string[] SortByColumns + { + get => Q("s"); + set => Q("s", value); + } + + /// Verbose mode. Display column headers. + public bool? Verbose + { + get => Q("v"); + set => Q("v", value); + } + } } diff --git a/src/OpenSearch.Net/Api/RequestParameters/RequestParameters.Cat.cs b/src/OpenSearch.Net/Api/RequestParameters/RequestParameters.Cat.cs index 7642c3d310..3cc529115e 100644 --- a/src/OpenSearch.Net/Api/RequestParameters/RequestParameters.Cat.cs +++ b/src/OpenSearch.Net/Api/RequestParameters/RequestParameters.Cat.cs @@ -51,82 +51,6 @@ // ReSharper disable once CheckNamespace namespace OpenSearch.Net.Specification.CatApi { - ///Request options for Tasks https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ - public class CatTasksRequestParameters : RequestParameters - { - public override HttpMethod DefaultHttpMethod => HttpMethod.GET; - public override bool SupportsBody => false; - ///A comma-separated list of actions that should be returned. Leave empty to return all. - public string[] Actions - { - get => Q("actions"); - set => Q("actions", value); - } - - ///Return detailed task information (default: false) - public bool? Detailed - { - get => Q("detailed"); - set => Q("detailed", value); - } - - ///a short version of the Accept header, e.g. json, yaml - public string Format - { - get => Q("format"); - set - { - Q("format", value); - SetAcceptHeader(value); - } - } - - ///Comma-separated list of column names to display - public string[] Headers - { - get => Q("h"); - set => Q("h", value); - } - - ///Return help information - public bool? Help - { - get => Q("help"); - set => Q("help", value); - } - - /// - /// A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're - /// connecting to, leave empty to get information from all nodes - /// - public string[] Nodes - { - get => Q("nodes"); - set => Q("nodes", value); - } - - ///Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - public string ParentTaskId - { - get => Q("parent_task_id"); - set => Q("parent_task_id", value); - } - - ///Comma-separated list of column names or column aliases to sort by - public string[] SortByColumns - { - get => Q("s"); - set => Q("s", value); - } - - ///Verbose mode. Display column headers - public bool? Verbose - { - get => Q("v"); - set => Q("v", value); - } - } - ///Request options for Templates https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ public class CatTemplatesRequestParameters : RequestParameters { diff --git a/src/OpenSearch.Net/OpenSearchLowLevelClient.Cat.cs b/src/OpenSearch.Net/OpenSearchLowLevelClient.Cat.cs index f19fa54ddc..38023aeebe 100644 --- a/src/OpenSearch.Net/OpenSearchLowLevelClient.Cat.cs +++ b/src/OpenSearch.Net/OpenSearchLowLevelClient.Cat.cs @@ -66,17 +66,6 @@ namespace OpenSearch.Net.Specification.CatApi /// public partial class LowLevelCatNamespace : NamespacedClientProxy { - ///GET on /_cat/tasks https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - ///Note: Experimental within the OpenSearch server, this functionality is Experimental and may be changed or removed completely in a future release. OpenSearch 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 Tasks(CatTasksRequestParameters requestParameters = null) - where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, "_cat/tasks", null, RequestParams(requestParameters)); - ///GET on /_cat/tasks https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - ///Note: Experimental within the OpenSearch server, this functionality is Experimental and may be changed or removed completely in a future release. OpenSearch 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("cat.tasks", "")] - public Task TasksAsync(CatTasksRequestParameters requestParameters = null, CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, "_cat/tasks", ctx, null, RequestParams(requestParameters)); ///GET on /_cat/templates https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ ///Request specific configuration such as querystring parameters & request specific connection settings. public TResponse Templates(CatTemplatesRequestParameters requestParameters = null) diff --git a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs index b78ff2e89b..e158237268 100644 --- a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs +++ b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs @@ -1295,4 +1295,81 @@ public bool? Verbose set => Q("v", value); } } + + /// Request options for Tasks https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/ + public partial class CatTasksRequestParameters : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.GET; + public override bool SupportsBody => false; + + /// Comma-separated list of actions that should be returned. Leave empty to return all. + public string[] Actions + { + get => Q("actions"); + set => Q("actions", value); + } + + /// Return detailed task information. + public bool? Detailed + { + get => Q("detailed"); + set => Q("detailed", value); + } + + /// A short version of the Accept header, e.g. json, yaml. + public string Format + { + get => Q("format"); + set + { + Q("format", value); + SetAcceptHeader(value); + } + } + + /// Comma-separated list of column names to display. + public string[] Headers + { + get => Q("h"); + set => Q("h", value); + } + + /// Return help information. + public bool? Help + { + get => Q("help"); + set => Q("help", value); + } + + /// + /// Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're + /// connecting to, leave empty to get information from all nodes. + /// + public string[] Nodes + { + get => Q("nodes"); + set => Q("nodes", value); + } + + /// Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. + public string ParentTaskId + { + get => Q("parent_task_id"); + set => Q("parent_task_id", value); + } + + /// Comma-separated list of column names or column aliases to sort by. + public string[] SortByColumns + { + get => Q("s"); + set => Q("s", value); + } + + /// Verbose mode. Display column headers. + public bool? Verbose + { + get => Q("v"); + set => Q("v", value); + } + } } diff --git a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs index 59658e946a..ec19788cc8 100644 --- a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs +++ b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs @@ -784,5 +784,27 @@ public Task SnapshotsAsync( null, RequestParams(requestParameters) ); + + /// GET on /_cat/tasks https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + public TResponse Tasks(CatTasksRequestParameters requestParameters = null) + where TResponse : class, IOpenSearchResponse, new() => + DoRequest(GET, "_cat/tasks", null, RequestParams(requestParameters)); + + /// GET on /_cat/tasks https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + [MapsApi("cat.tasks", "")] + public Task TasksAsync( + CatTasksRequestParameters requestParameters = null, + CancellationToken ctx = default + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequestAsync( + GET, + "_cat/tasks", + ctx, + null, + RequestParams(requestParameters) + ); } } From 9916993cb0a83dd0222f3e7eab6a5e15a80d18ca Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 18 Jan 2024 17:27:09 +1300 Subject: [PATCH 8/9] Re-generate cat.templates Signed-off-by: Thomas Farr --- .../Configuration/CodeConfiguration.cs | 1 + src/OpenSearch.Client/ApiUrlsLookup.cs | 1 - src/OpenSearch.Client/Descriptors.Cat.cs | 40 -------- src/OpenSearch.Client/OpenSearchClient.Cat.cs | 24 ----- src/OpenSearch.Client/Requests.Cat.cs | 93 ------------------ .../_Generated/ApiUrlsLookup.cs | 3 + .../_Generated/Descriptors.Cat.cs | 60 ++++++++++++ .../_Generated/OpenSearchClient.Cat.cs | 41 ++++++++ .../_Generated/Requests.Cat.cs | 94 +++++++++++++++++++ .../RequestParameters.Cat.cs | 68 -------------- .../OpenSearchLowLevelClient.Cat.cs | 20 ---- .../RequestParameters.Cat.cs | 72 ++++++++++++++ .../OpenSearchLowLevelClient.Cat.cs | 57 +++++++++++ 13 files changed, 328 insertions(+), 246 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 58e2926417..b9b609ca62 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -61,6 +61,7 @@ public static class CodeConfiguration new("cat.shards"), new("cat.snapshots"), new("cat.tasks"), + new("cat.templates"), new("cluster.*"), new("dangling_indices.*"), diff --git a/src/OpenSearch.Client/ApiUrlsLookup.cs b/src/OpenSearch.Client/ApiUrlsLookup.cs index 94594be866..1ab192e1cb 100644 --- a/src/OpenSearch.Client/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/ApiUrlsLookup.cs @@ -46,7 +46,6 @@ namespace OpenSearch.Client internal static partial class ApiUrlsLookups { internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[]{"_bulk", "{index}/_bulk"}); - internal static ApiUrls CatTemplates = new ApiUrls(new[]{"_cat/templates", "_cat/templates/{name}"}); internal static ApiUrls CatThreadPool = new ApiUrls(new[]{"_cat/thread_pool", "_cat/thread_pool/{thread_pool_patterns}"}); internal static ApiUrls NoNamespaceClearScroll = new ApiUrls(new[]{"_search/scroll"}); internal static ApiUrls NoNamespaceCount = new ApiUrls(new[]{"_count", "{index}/_count"}); diff --git a/src/OpenSearch.Client/Descriptors.Cat.cs b/src/OpenSearch.Client/Descriptors.Cat.cs index 8f6bd1150d..7030641939 100644 --- a/src/OpenSearch.Client/Descriptors.Cat.cs +++ b/src/OpenSearch.Client/Descriptors.Cat.cs @@ -57,46 +57,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - ///Descriptor for Templates https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - public partial class CatTemplatesDescriptor : RequestDescriptorBase, ICatTemplatesRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatTemplates; - ////_cat/templates - public CatTemplatesDescriptor(): base() - { - } - - ////_cat/templates/{name} - ///Optional, accepts null - public CatTemplatesDescriptor(Name name): base(r => r.Optional("name", name)) - { - } - - // values part of the url path - Name ICatTemplatesRequest.Name => Self.RouteValues.Get("name"); - ///A pattern that returned template names must match - public CatTemplatesDescriptor Name(Name name) => Assign(name, (a, v) => a.RouteValues.Optional("name", v)); - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public CatTemplatesDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatTemplatesDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatTemplatesDescriptor Help(bool? help = true) => Qs("help", help); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public CatTemplatesDescriptor Local(bool? local = true) => Qs("local", local); - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CatTemplatesDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Explicit operation timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CatTemplatesDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Comma-separated list of column names or column aliases to sort by - public CatTemplatesDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatTemplatesDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } - ///Descriptor for ThreadPool https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/ public partial class CatThreadPoolDescriptor : RequestDescriptorBase, ICatThreadPoolRequest { diff --git a/src/OpenSearch.Client/OpenSearchClient.Cat.cs b/src/OpenSearch.Client/OpenSearchClient.Cat.cs index 375c7dd0f3..075ca796d4 100644 --- a/src/OpenSearch.Client/OpenSearchClient.Cat.cs +++ b/src/OpenSearch.Client/OpenSearchClient.Cat.cs @@ -59,30 +59,6 @@ namespace OpenSearch.Client.Specification.CatApi /// public partial class CatNamespace : NamespacedClientProxy { - /// - /// GET request to the cat.templates API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public CatResponse Templates(Func selector = null) => Templates(selector.InvokeOrDefault(new CatTemplatesDescriptor())); - /// - /// GET request to the cat.templates API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public Task> TemplatesAsync(Func selector = null, CancellationToken ct = default) => TemplatesAsync(selector.InvokeOrDefault(new CatTemplatesDescriptor()), ct); - /// - /// GET request to the cat.templates API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public CatResponse Templates(ICatTemplatesRequest request) => DoCat(request); - /// - /// GET request to the cat.templates API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public Task> TemplatesAsync(ICatTemplatesRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); /// /// GET request to the cat.thread_pool API, read more about this API online: /// diff --git a/src/OpenSearch.Client/Requests.Cat.cs b/src/OpenSearch.Client/Requests.Cat.cs index 7733e72630..ee111674c6 100644 --- a/src/OpenSearch.Client/Requests.Cat.cs +++ b/src/OpenSearch.Client/Requests.Cat.cs @@ -58,99 +58,6 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - [InterfaceDataContract] - public partial interface ICatTemplatesRequest : IRequest - { - [IgnoreDataMember] - Name Name - { - get; - } - } - - ///Request for Templates https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - public partial class CatTemplatesRequest : PlainRequestBase, ICatTemplatesRequest - { - protected ICatTemplatesRequest Self => this; - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatTemplates; - ////_cat/templates - public CatTemplatesRequest(): base() - { - } - - ////_cat/templates/{name} - ///Optional, accepts null - public CatTemplatesRequest(Name name): base(r => r.Optional("name", name)) - { - } - - // values part of the url path - [IgnoreDataMember] - Name ICatTemplatesRequest.Name => Self.RouteValues.Get("name"); - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public string Format - { - get => Q("format"); - set - { - Q("format", value); - SetAcceptHeader(value); - } - } - - ///Comma-separated list of column names to display - public string[] Headers - { - get => Q("h"); - set => Q("h", value); - } - - ///Return help information - public bool? Help - { - get => Q("help"); - set => Q("help", value); - } - - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public bool? Local - { - get => Q("local"); - set => Q("local", value); - } - - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public Time MasterTimeout - { - get => Q public partial class LowLevelCatNamespace : NamespacedClientProxy { - ///GET on /_cat/templates https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - public TResponse Templates(CatTemplatesRequestParameters requestParameters = null) - where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, "_cat/templates", null, RequestParams(requestParameters)); - ///GET on /_cat/templates https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - ///Request specific configuration such as querystring parameters & request specific connection settings. - [MapsApi("cat.templates", "")] - public Task TemplatesAsync(CatTemplatesRequestParameters requestParameters = null, CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, "_cat/templates", ctx, null, RequestParams(requestParameters)); - ///GET on /_cat/templates/{name} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - ///A pattern that returned template names must match - ///Request specific configuration such as querystring parameters & request specific connection settings. - public TResponse Templates(string name, CatTemplatesRequestParameters requestParameters = null) - where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, Url($"_cat/templates/{name:name}"), null, RequestParams(requestParameters)); - ///GET on /_cat/templates/{name} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - ///A pattern that returned template names must match - ///Request specific configuration such as querystring parameters & request specific connection settings. - [MapsApi("cat.templates", "name")] - public Task TemplatesAsync(string name, CatTemplatesRequestParameters requestParameters = null, CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, Url($"_cat/templates/{name:name}"), ctx, null, RequestParams(requestParameters)); ///GET on /_cat/thread_pool https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/ ///Request specific configuration such as querystring parameters & request specific connection settings. public TResponse ThreadPool(CatThreadPoolRequestParameters requestParameters = null) diff --git a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs index e158237268..d8e66a33c0 100644 --- a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs +++ b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Cat.cs @@ -1372,4 +1372,76 @@ public bool? Verbose set => Q("v", value); } } + + /// Request options for Templates https://opensearch.org/docs/latest/api-reference/cat/cat-templates/ + public partial class CatTemplatesRequestParameters + : RequestParameters + { + public override HttpMethod DefaultHttpMethod => HttpMethod.GET; + public override bool SupportsBody => false; + + /// Operation timeout for connection to cluster-manager node. + /// Supported by OpenSearch servers of version 2.0.0 or greater. + public TimeSpan ClusterManagerTimeout + { + get => Q("cluster_manager_timeout"); + set => Q("cluster_manager_timeout", value); + } + + /// A short version of the Accept header, e.g. json, yaml. + public string Format + { + get => Q("format"); + set + { + Q("format", value); + SetAcceptHeader(value); + } + } + + /// Comma-separated list of column names to display. + public string[] Headers + { + get => Q("h"); + set => Q("h", value); + } + + /// Return help information. + public bool? Help + { + get => Q("help"); + set => Q("help", value); + } + + /// Return local information, do not retrieve the state from cluster-manager node. + public bool? Local + { + get => Q("local"); + set => Q("local", value); + } + + /// Operation timeout for connection to master node. + [Obsolete( + "Deprecated as of: 2.0.0, reason: To promote inclusive language, use 'cluster_manager_timeout' instead." + )] + public TimeSpan MasterTimeout + { + get => Q("master_timeout"); + set => Q("master_timeout", value); + } + + /// Comma-separated list of column names or column aliases to sort by. + public string[] SortByColumns + { + get => Q("s"); + set => Q("s", value); + } + + /// Verbose mode. Display column headers. + public bool? Verbose + { + get => Q("v"); + set => Q("v", value); + } + } } diff --git a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs index ec19788cc8..bf4423f1a9 100644 --- a/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs +++ b/src/OpenSearch.Net/_Generated/OpenSearchLowLevelClient.Cat.cs @@ -806,5 +806,62 @@ public Task TasksAsync( null, RequestParams(requestParameters) ); + + /// GET on /_cat/templates https://opensearch.org/docs/latest/api-reference/cat/cat-templates/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + public TResponse Templates( + CatTemplatesRequestParameters requestParameters = null + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequest(GET, "_cat/templates", null, RequestParams(requestParameters)); + + /// GET on /_cat/templates https://opensearch.org/docs/latest/api-reference/cat/cat-templates/ + /// Request specific configuration such as querystring parameters & request specific connection settings. + [MapsApi("cat.templates", "")] + public Task TemplatesAsync( + CatTemplatesRequestParameters requestParameters = null, + CancellationToken ctx = default + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequestAsync( + GET, + "_cat/templates", + ctx, + null, + RequestParams(requestParameters) + ); + + /// GET on /_cat/templates/{name} https://opensearch.org/docs/latest/api-reference/cat/cat-templates/ + /// The name of the template. + /// Request specific configuration such as querystring parameters & request specific connection settings. + public TResponse Templates( + string name, + CatTemplatesRequestParameters requestParameters = null + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequest( + GET, + Url($"_cat/templates/{name:name}"), + null, + RequestParams(requestParameters) + ); + + /// GET on /_cat/templates/{name} https://opensearch.org/docs/latest/api-reference/cat/cat-templates/ + /// The name of the template. + /// Request specific configuration such as querystring parameters & request specific connection settings. + [MapsApi("cat.templates", "name")] + public Task TemplatesAsync( + string name, + CatTemplatesRequestParameters requestParameters = null, + CancellationToken ctx = default + ) + where TResponse : class, IOpenSearchResponse, new() => + DoRequestAsync( + GET, + Url($"_cat/templates/{name:name}"), + ctx, + null, + RequestParams(requestParameters) + ); } } From e5699fca678ce1c3a39e3d4df5cee8ad4b0f370f Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 18 Jan 2024 17:36:37 +1300 Subject: [PATCH 9/9] Re-generate cat.thread_pool Signed-off-by: Thomas Farr --- .../Configuration/CodeConfiguration.cs | 1 + src/OpenSearch.Client/ApiUrlsLookup.cs | 1 - src/OpenSearch.Client/Descriptors.Cat.cs | 99 ------------ src/OpenSearch.Client/OpenSearchClient.Cat.cs | 87 ---------- src/OpenSearch.Client/Requests.Cat.cs | 153 ------------------ .../_Generated/ApiUrlsLookup.cs | 3 + .../_Generated/Descriptors.Cat.cs | 64 ++++++++ .../_Generated/OpenSearchClient.Cat.cs | 43 +++++ .../_Generated/Requests.Cat.cs | 102 ++++++++++++ .../RequestParameters.Cat.cs | 121 -------------- .../OpenSearchLowLevelClient.Cat.cs | 90 ----------- .../RequestParameters.Cat.cs | 79 +++++++++ .../OpenSearchLowLevelClient.Cat.cs | 57 +++++++ 13 files changed, 349 insertions(+), 551 deletions(-) delete mode 100644 src/OpenSearch.Client/Descriptors.Cat.cs delete mode 100644 src/OpenSearch.Client/OpenSearchClient.Cat.cs delete mode 100644 src/OpenSearch.Client/Requests.Cat.cs delete mode 100644 src/OpenSearch.Net/Api/RequestParameters/RequestParameters.Cat.cs delete mode 100644 src/OpenSearch.Net/OpenSearchLowLevelClient.Cat.cs diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index b9b609ca62..b27df8490d 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -62,6 +62,7 @@ public static class CodeConfiguration new("cat.snapshots"), new("cat.tasks"), new("cat.templates"), + new("cat.thread_pool"), new("cluster.*"), new("dangling_indices.*"), diff --git a/src/OpenSearch.Client/ApiUrlsLookup.cs b/src/OpenSearch.Client/ApiUrlsLookup.cs index 1ab192e1cb..8937a41d24 100644 --- a/src/OpenSearch.Client/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/ApiUrlsLookup.cs @@ -46,7 +46,6 @@ namespace OpenSearch.Client internal static partial class ApiUrlsLookups { internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[]{"_bulk", "{index}/_bulk"}); - internal static ApiUrls CatThreadPool = new ApiUrls(new[]{"_cat/thread_pool", "_cat/thread_pool/{thread_pool_patterns}"}); internal static ApiUrls NoNamespaceClearScroll = new ApiUrls(new[]{"_search/scroll"}); internal static ApiUrls NoNamespaceCount = new ApiUrls(new[]{"_count", "{index}/_count"}); internal static ApiUrls NoNamespaceCreate = new ApiUrls(new[]{"{index}/_create/{id}"}); diff --git a/src/OpenSearch.Client/Descriptors.Cat.cs b/src/OpenSearch.Client/Descriptors.Cat.cs deleted file mode 100644 index 7030641939..0000000000 --- a/src/OpenSearch.Client/Descriptors.Cat.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 -* -* The OpenSearch Contributors require contributions made to -* this file be licensed under the Apache-2.0 license or a -* compatible open source license. -*/ -/* -* Modifications Copyright OpenSearch Contributors. See -* GitHub history for details. -* -* Licensed to Elasticsearch B.V. under one or more contributor -* license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright -* ownership. Elasticsearch B.V. licenses this file to you under -* the Apache License, Version 2.0 (the "License"); you may -* not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ----------------------------------------------- -// -// This file is automatically generated -// Please do not edit these files manually -// Run the following in the root of the repos: -// -// *NIX : ./build.sh codegen -// Windows : build.bat codegen -// -// ----------------------------------------------- -// ReSharper disable RedundantUsingDirective -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Linq.Expressions; -using OpenSearch.Net; -using OpenSearch.Net.Utf8Json; -using OpenSearch.Net.Specification.CatApi; - -// ReSharper disable RedundantBaseConstructorCall -// ReSharper disable UnusedTypeParameter -// ReSharper disable PartialMethodWithSinglePart -// ReSharper disable RedundantNameQualifier -namespace OpenSearch.Client -{ - ///Descriptor for ThreadPool https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/ - public partial class CatThreadPoolDescriptor : RequestDescriptorBase, ICatThreadPoolRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatThreadPool; - ////_cat/thread_pool - public CatThreadPoolDescriptor(): base() - { - } - - ////_cat/thread_pool/{thread_pool_patterns} - ///Optional, accepts null - public CatThreadPoolDescriptor(Names threadPoolPatterns): base(r => r.Optional("thread_pool_patterns", threadPoolPatterns)) - { - } - - // values part of the url path - Names ICatThreadPoolRequest.ThreadPoolPatterns => Self.RouteValues.Get("thread_pool_patterns"); - ///A comma-separated list of regular-expressions to filter the thread pools in the output - public CatThreadPoolDescriptor ThreadPoolPatterns(Names threadPoolPatterns) => Assign(threadPoolPatterns, (a, v) => a.RouteValues.Optional("thread_pool_patterns", v)); - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public CatThreadPoolDescriptor Format(string format) => Qs("format", format); - ///Comma-separated list of column names to display - public CatThreadPoolDescriptor Headers(params string[] headers) => Qs("h", headers); - ///Return help information - public CatThreadPoolDescriptor Help(bool? help = true) => Qs("help", help); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public CatThreadPoolDescriptor Local(bool? local = true) => Qs("local", local); - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CatThreadPoolDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Explicit operation timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CatThreadPoolDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Comma-separated list of column names or column aliases to sort by - public CatThreadPoolDescriptor SortByColumns(params string[] sortbycolumns) => Qs("s", sortbycolumns); - ///Verbose mode. Display column headers - public CatThreadPoolDescriptor Verbose(bool? verbose = true) => Qs("v", verbose); - } -} diff --git a/src/OpenSearch.Client/OpenSearchClient.Cat.cs b/src/OpenSearch.Client/OpenSearchClient.Cat.cs deleted file mode 100644 index 075ca796d4..0000000000 --- a/src/OpenSearch.Client/OpenSearchClient.Cat.cs +++ /dev/null @@ -1,87 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 -* -* The OpenSearch Contributors require contributions made to -* this file be licensed under the Apache-2.0 license or a -* compatible open source license. -*/ -/* -* Modifications Copyright OpenSearch Contributors. See -* GitHub history for details. -* -* Licensed to Elasticsearch B.V. under one or more contributor -* license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright -* ownership. Elasticsearch B.V. licenses this file to you under -* the Apache License, Version 2.0 (the "License"); you may -* not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ----------------------------------------------- -// -// This file is automatically generated -// Please do not edit these files manually -// Run the following in the root of the repos: -// -// *NIX : ./build.sh codegen -// Windows : build.bat codegen -// -// ----------------------------------------------- -// ReSharper disable RedundantUsingDirective -using System; -using System.Threading; -using System.Threading.Tasks; -using OpenSearch.Net.Specification.CatApi; - -// ReSharper disable once CheckNamespace -// ReSharper disable RedundantTypeArgumentsOfMethod -namespace OpenSearch.Client.Specification.CatApi -{ - /// - /// Cat APIs. - /// Not intended to be instantiated directly. Use the property - /// on . - /// - /// - public partial class CatNamespace : NamespacedClientProxy - { - /// - /// GET request to the cat.thread_pool API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/ - /// - public CatResponse ThreadPool(Func selector = null) => ThreadPool(selector.InvokeOrDefault(new CatThreadPoolDescriptor())); - /// - /// GET request to the cat.thread_pool API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/ - /// - public Task> ThreadPoolAsync(Func selector = null, CancellationToken ct = default) => ThreadPoolAsync(selector.InvokeOrDefault(new CatThreadPoolDescriptor()), ct); - /// - /// GET request to the cat.thread_pool API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/ - /// - public CatResponse ThreadPool(ICatThreadPoolRequest request) => DoCat(request); - /// - /// GET request to the cat.thread_pool API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/ - /// - public Task> ThreadPoolAsync(ICatThreadPoolRequest request, CancellationToken ct = default) => DoCatAsync(request, ct); - } -} diff --git a/src/OpenSearch.Client/Requests.Cat.cs b/src/OpenSearch.Client/Requests.Cat.cs deleted file mode 100644 index ee111674c6..0000000000 --- a/src/OpenSearch.Client/Requests.Cat.cs +++ /dev/null @@ -1,153 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 -* -* The OpenSearch Contributors require contributions made to -* this file be licensed under the Apache-2.0 license or a -* compatible open source license. -*/ -/* -* Modifications Copyright OpenSearch Contributors. See -* GitHub history for details. -* -* Licensed to Elasticsearch B.V. under one or more contributor -* license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright -* ownership. Elasticsearch B.V. licenses this file to you under -* the Apache License, Version 2.0 (the "License"); you may -* not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ----------------------------------------------- -// -// This file is automatically generated -// Please do not edit these files manually -// Run the following in the root of the repos: -// -// *NIX : ./build.sh codegen -// Windows : build.bat codegen -// -// ----------------------------------------------- -// ReSharper disable RedundantUsingDirective -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Linq.Expressions; -using System.Runtime.Serialization; -using OpenSearch.Net; -using OpenSearch.Net.Utf8Json; -using OpenSearch.Net.Specification.CatApi; - -// ReSharper disable RedundantBaseConstructorCall -// ReSharper disable UnusedTypeParameter -// ReSharper disable PartialMethodWithSinglePart -// ReSharper disable RedundantNameQualifier -namespace OpenSearch.Client -{ - [InterfaceDataContract] - public partial interface ICatThreadPoolRequest : IRequest - { - [IgnoreDataMember] - Names ThreadPoolPatterns - { - get; - } - } - - ///Request for ThreadPool https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/ - public partial class CatThreadPoolRequest : PlainRequestBase, ICatThreadPoolRequest - { - protected ICatThreadPoolRequest Self => this; - internal override ApiUrls ApiUrls => ApiUrlsLookups.CatThreadPool; - ////_cat/thread_pool - public CatThreadPoolRequest(): base() - { - } - - ////_cat/thread_pool/{thread_pool_patterns} - ///Optional, accepts null - public CatThreadPoolRequest(Names threadPoolPatterns): base(r => r.Optional("thread_pool_patterns", threadPoolPatterns)) - { - } - - // values part of the url path - [IgnoreDataMember] - Names ICatThreadPoolRequest.ThreadPoolPatterns => Self.RouteValues.Get("thread_pool_patterns"); - // Request parameters - ///a short version of the Accept header, e.g. json, yaml - public string Format - { - get => Q("format"); - set - { - Q("format", value); - SetAcceptHeader(value); - } - } - - ///Comma-separated list of column names to display - public string[] Headers - { - get => Q("h"); - set => Q("h", value); - } - - ///Return help information - public bool? Help - { - get => Q("help"); - set => Q("help", value); - } - - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public bool? Local - { - get => Q("local"); - set => Q("local", value); - } - - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public Time MasterTimeout - { - get => Q