Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support list for opensearch_version in PluginStats #568

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/integration-yaml-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
fail-fast: false
matrix:
version:
- 2.12.0
- 2.11.1
- 2.10.0
- 2.8.0
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
fail-fast: false
matrix:
version:
- 2.12.0
- 2.11.1
- 2.10.0
- 2.8.0
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 12 additions & 1 deletion src/OpenSearch.Client/CommonOptions/Stats/PluginStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -41,7 +44,15 @@ public class PluginStats
public string Description { get; set; }

[DataMember(Name ="opensearch_version")]
public string OpenSearchVersion { get; set; }
[JsonFormatter(typeof(InterfaceReadOnlyCollectionSingleOrEnumerableFormatter<string>))]
public IReadOnlyCollection<string> OpenSearchVersions { get; set; }

[IgnoreDataMember]
public string OpenSearchVersion
{
get => OpenSearchVersions?.SingleOrDefault();
set => OpenSearchVersions = new [] { value };
}

[DataMember(Name ="extended_plugins")]
public IReadOnlyCollection<string> ExtendedPlugins { get; set; }
Expand Down
Loading