From 803196ab3950084c0b589a6205e5ee53d319ac4f Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Fri, 1 Mar 2024 11:57:14 +1300 Subject: [PATCH 1/2] Support list for `opensearch_version` in PluginStats Signed-off-by: Thomas Farr --- .../CommonOptions/Stats/PluginStats.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/OpenSearch.Client/CommonOptions/Stats/PluginStats.cs b/src/OpenSearch.Client/CommonOptions/Stats/PluginStats.cs index 59094e5a7e..4c2a3a881a 100644 --- a/src/OpenSearch.Client/CommonOptions/Stats/PluginStats.cs +++ b/src/OpenSearch.Client/CommonOptions/Stats/PluginStats.cs @@ -27,7 +27,10 @@ */ using System.Collections.Generic; +using System.Linq; using System.Runtime.Serialization; +using OpenSearch.Net; +using OpenSearch.Net.Utf8Json; namespace OpenSearch.Client { @@ -41,7 +44,15 @@ public class PluginStats public string Description { get; set; } [DataMember(Name ="opensearch_version")] - public string OpenSearchVersion { get; set; } + [JsonFormatter(typeof(InterfaceReadOnlyCollectionSingleOrEnumerableFormatter))] + public IReadOnlyCollection OpenSearchVersions { get; set; } + + [IgnoreDataMember] + public string OpenSearchVersion + { + get => OpenSearchVersions?.SingleOrDefault(); + set => OpenSearchVersions = new [] { value }; + } [DataMember(Name ="extended_plugins")] public IReadOnlyCollection ExtendedPlugins { get; set; } From acffe9b609c94476a9777f6801a76a0ba920b005 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Fri, 1 Mar 2024 12:37:19 +1300 Subject: [PATCH 2/2] Update CHANGELOG Signed-off-by: Thomas Farr --- .github/workflows/integration-yaml-tests.yml | 1 + .github/workflows/integration.yml | 1 + CHANGELOG.md | 3 +++ 3 files changed, 5 insertions(+) diff --git a/.github/workflows/integration-yaml-tests.yml b/.github/workflows/integration-yaml-tests.yml index b8799a62fe..5426ba1b9a 100644 --- a/.github/workflows/integration-yaml-tests.yml +++ b/.github/workflows/integration-yaml-tests.yml @@ -14,6 +14,7 @@ jobs: fail-fast: false matrix: version: + - 2.12.0 - 2.11.1 - 2.10.0 - 2.8.0 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index b882ad77ec..69c18da706 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -17,6 +17,7 @@ jobs: fail-fast: false matrix: version: + - 2.12.0 - 2.11.1 - 2.10.0 - 2.8.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e5ef2695f..1a0924d82c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - 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)) - Removed the deprecated low-level `IndexTemplateV2` APIs in favour of the `ComposableIndexTemplate` APIs ([#437](https://github.com/opensearch-project/opensearch-net/pull/437)) +### Changed +- Changed `PluginStats.OpenSearchVersion` to support both a single value and a list returned by OpenSearch `>=2.13.0` ([#568](https://github.com/opensearch-project/opensearch-net/pull/568)) + ### Dependencies - Bumps `System.Diagnostics.DiagnosticSource` from 6.0.1 to 8.0.0