From e5699fca678ce1c3a39e3d4df5cee8ad4b0f370f Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 18 Jan 2024 17:36:37 +1300 Subject: [PATCH] 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