From c69105b0da91bc88a1bb7945077ce98558dd93be Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Wed, 23 Aug 2023 18:45:16 +1200 Subject: [PATCH] Remove features API not supported by OpenSearch (#331) It was added to Elasticsearch in v7.12, whereas OpenSearch forked ~v7.10 Signed-off-by: Thomas Farr --- CHANGELOG.md | 5 +- .../RequestParameters.Features.cs | 75 ----------------- .../IOpenSearchLowLevelClient.Generated.cs | 7 -- .../OpenSearchLowLevelClient.Features.cs | 83 ------------------- .../OpenSearchLowLevelClient.NoNamespace.cs | 8 -- 5 files changed, 4 insertions(+), 174 deletions(-) delete mode 100644 src/OpenSearch.Net/Api/RequestParameters/RequestParameters.Features.cs delete mode 100644 src/OpenSearch.Net/OpenSearchLowLevelClient.Features.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 3974cf9d50..5912f94372 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Fixed - Fix highlight max_analyzer_offset field name to match with the one introduced in OpenSearch 2.2.0 ([#322](https://github.com/opensearch-project/opensearch-net/pull/322)) +### Removed +- Removed the `Features` API which is not supported by OpenSearch from the low-level client ([#331](https://github.com/opensearch-project/opensearch-net/pull/331)) + ### Dependencies - Bumps `Microsoft.CodeAnalysis.CSharp` from 4.2.0 to 4.6.0 - Bumps `Microsoft.TestPlatform.ObjectModel` from 17.5.0 to 17.7.1 @@ -91,4 +94,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) [Unreleased]: https://github.com/opensearch-project/opensearch-net/compare/v1.4.0...main [1.4.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.3.0...v1.4.0 -[1.3.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.2.0...v1.3.0 \ No newline at end of file +[1.3.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.2.0...v1.3.0 diff --git a/src/OpenSearch.Net/Api/RequestParameters/RequestParameters.Features.cs b/src/OpenSearch.Net/Api/RequestParameters/RequestParameters.Features.cs deleted file mode 100644 index e93e913bb1..0000000000 --- a/src/OpenSearch.Net/Api/RequestParameters/RequestParameters.Features.cs +++ /dev/null @@ -1,75 +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; - -// ReSharper disable once CheckNamespace -namespace OpenSearch.Net.Specification.FeaturesApi -{ - ///Request options for Get h - public class GetFeaturesRequestParameters : RequestParameters - { - public override HttpMethod DefaultHttpMethod => HttpMethod.GET; - public override bool SupportsBody => false; - ///Explicit operation timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public TimeSpan MasterTimeSpanout - { - get => Q("master_timeout"); - set => Q("master_timeout", value); - } - - ///Explicit operation timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public TimeSpan ClusterManagerTimeSpanout - { - get => Q("cluster_manager_timeout"); - set => Q("cluster_manager_timeout", value); - } - } -} diff --git a/src/OpenSearch.Net/IOpenSearchLowLevelClient.Generated.cs b/src/OpenSearch.Net/IOpenSearchLowLevelClient.Generated.cs index a4cebb92ac..100bc524d7 100644 --- a/src/OpenSearch.Net/IOpenSearchLowLevelClient.Generated.cs +++ b/src/OpenSearch.Net/IOpenSearchLowLevelClient.Generated.cs @@ -53,7 +53,6 @@ using OpenSearch.Net.Specification.CatApi; using OpenSearch.Net.Specification.ClusterApi; using OpenSearch.Net.Specification.DanglingIndicesApi; -using OpenSearch.Net.Specification.FeaturesApi; using OpenSearch.Net.Specification.IndicesApi; using OpenSearch.Net.Specification.IngestApi; using OpenSearch.Net.Specification.NodesApi; @@ -85,12 +84,6 @@ LowLevelDanglingIndicesNamespace DanglingIndices get; } - ///Features APIs - LowLevelFeaturesNamespace Features - { - get; - } - ///Indices APIs LowLevelIndicesNamespace Indices { diff --git a/src/OpenSearch.Net/OpenSearchLowLevelClient.Features.cs b/src/OpenSearch.Net/OpenSearchLowLevelClient.Features.cs deleted file mode 100644 index e59a40647e..0000000000 --- a/src/OpenSearch.Net/OpenSearchLowLevelClient.Features.cs +++ /dev/null @@ -1,83 +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.Collections.Specialized; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using OpenSearch.Net; -using static OpenSearch.Net.HttpMethod; - -// ReSharper disable InterpolatedStringExpressionIsNotIFormattable -// ReSharper disable once CheckNamespace -// ReSharper disable InterpolatedStringExpressionIsNotIFormattable -// ReSharper disable RedundantExtendsListEntry -namespace OpenSearch.Net.Specification.FeaturesApi -{ - /// - /// Features APIs. - /// Not intended to be instantiated directly. Use the property - /// on . - /// - /// - public partial class LowLevelFeaturesNamespace : NamespacedClientProxy - { - internal LowLevelFeaturesNamespace(OpenSearchLowLevelClient client): base(client) - { - } - - ///GET on /_features h - ///Request specific configuration such as querystring parameters & request specific connection settings. - public TResponse Get(GetFeaturesRequestParameters requestParameters = null) - where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, "_features", null, RequestParams(requestParameters)); - ///GET on /_features h - ///Request specific configuration such as querystring parameters & request specific connection settings. - [MapsApi("features.get_features", "")] - public Task GetAsync(GetFeaturesRequestParameters requestParameters = null, CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, "_features", ctx, null, RequestParams(requestParameters)); - } -} diff --git a/src/OpenSearch.Net/OpenSearchLowLevelClient.NoNamespace.cs b/src/OpenSearch.Net/OpenSearchLowLevelClient.NoNamespace.cs index ddccdda907..86dfd6991b 100644 --- a/src/OpenSearch.Net/OpenSearchLowLevelClient.NoNamespace.cs +++ b/src/OpenSearch.Net/OpenSearchLowLevelClient.NoNamespace.cs @@ -53,7 +53,6 @@ using OpenSearch.Net.Specification.CatApi; using OpenSearch.Net.Specification.ClusterApi; using OpenSearch.Net.Specification.DanglingIndicesApi; -using OpenSearch.Net.Specification.FeaturesApi; using OpenSearch.Net.Specification.IndicesApi; using OpenSearch.Net.Specification.IngestApi; using OpenSearch.Net.Specification.NodesApi; @@ -88,12 +87,6 @@ public LowLevelDanglingIndicesNamespace DanglingIndices private set; } - public LowLevelFeaturesNamespace Features - { - get; - private set; - } - public LowLevelIndicesNamespace Indices { get; @@ -123,7 +116,6 @@ partial void SetupNamespaces() Cat = new LowLevelCatNamespace(this); Cluster = new LowLevelClusterNamespace(this); DanglingIndices = new LowLevelDanglingIndicesNamespace(this); - Features = new LowLevelFeaturesNamespace(this); Indices = new LowLevelIndicesNamespace(this); Ingest = new LowLevelIngestNamespace(this); Nodes = new LowLevelNodesNamespace(this);