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

Move cluster API requests into the .Specification.ClusterApi namespace #202

Merged
merged 4 commits into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### ⚠️ Breaking Changes ⚠️
- Moved `OpenSearch.Client` request classes into their respective namespaces to match those in `OpenSearch.Net` ([#202](https://github.com/opensearch-project/opensearch-net/pull/202))

### Dependencies
- Bumps `System.Reflection.Emit` from 4.3.0 to 4.7.0
- Bumps `Argu` from 5.5.0 to 6.1.1
Expand Down Expand Up @@ -53,4 +56,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Bumps `Microsoft.NETFramework.ReferenceAssemblies` from 1.0.0-preview.2 to 1.0.3

[Unreleased]: https://github.com/opensearch-project/opensearch-net/compare/1.3.0...HEAD
[1.3.0]: https://github.com/opensearch-project/opensearch-net/compare/1.2.0...1.3.0
[1.3.0]: https://github.com/opensearch-project/opensearch-net/compare/1.2.0...1.3.0
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

using System.Runtime.Serialization;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[MapsApi("cluster.allocation_explain.json")]
[ReadAs(typeof(ClusterAllocationExplainRequest))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
using System.Runtime.Serialization;
using OpenSearch.Net;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[DataContract]
public class ClusterAllocationExplainResponse : ResponseBase
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch.Client/Cluster/ClusterHealth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
using System.Runtime.Serialization;
using OpenSearch.Net;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[StringEnum]
public enum ClusterStatus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* under the License.
*/

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[MapsApi("cluster.health.json")]
public partial interface IClusterHealthRequest { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
using OpenSearch.Net;
using OpenSearch.Net.Utf8Json;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[DataContract]
public class ClusterHealthResponse : ResponseBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
using OpenSearch.Net;
using OpenSearch.Net.Utf8Json;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[DataContract]
public class IndexHealthStats
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
using OpenSearch.Net;
using System.Runtime.Serialization;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[DataContract]
public class ShardHealthStats
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* under the License.
*/

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[MapsApi("cluster.pending_tasks.json")]
public partial interface IClusterPendingTasksRequest { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
using System.Runtime.Serialization;
using OpenSearch.Net;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[DataContract]
public class ClusterPendingTasksResponse : ResponseBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

using System.Runtime.Serialization;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[DataContract]
public class ClusterRerouteDecision
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[DataContract]
public class ClusterRerouteExplanation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

using System.Runtime.Serialization;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[DataContract]
public class ClusterRerouteParameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[MapsApi("cluster.reroute.json")]
[ReadAs(typeof(ClusterRerouteRequest))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
using System.Runtime.Serialization;
using OpenSearch.Net;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[DataContract]
public class ClusterRerouteResponse : ResponseBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

using System.Runtime.Serialization;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
public interface IAllocateClusterRerouteCommand : IClusterRerouteCommand
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

using System.Runtime.Serialization;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
public interface ICancelClusterRerouteCommand : IClusterRerouteCommand
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
using OpenSearch.Net.Utf8Json.Resolvers;


namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
internal class ClusterRerouteCommandFormatter : IJsonFormatter<IClusterRerouteCommand>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
using System.Runtime.Serialization;
using OpenSearch.Net.Utf8Json;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[JsonFormatter(typeof(ClusterRerouteCommandFormatter))]
public interface IClusterRerouteCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

using System.Runtime.Serialization;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
public interface IMoveClusterRerouteCommand : IClusterRerouteCommand
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* under the License.
*/

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[MapsApi("cluster.get_settings.json")]
public partial interface IClusterGetSettingsRequest { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
using System.Runtime.Serialization;
using OpenSearch.Net;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[DataContract]
public class ClusterGetSettingsResponse : ResponseBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[MapsApi("cluster.put_settings.json")]
public partial interface IClusterPutSettingsRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
using System.Runtime.Serialization;
using OpenSearch.Net;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[DataContract]
public class ClusterPutSettingsResponse : ResponseBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
using System.Collections.Generic;
using System.Linq;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
/// <summary>
/// Simplifies the creation of remote cluster configuration, can be combined with a dictionary using the overloaded + operator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* under the License.
*/

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[MapsApi("cluster.state.json")]
public partial interface IClusterStateRequest { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
using OpenSearch.Net;
using OpenSearch.Net.Utf8Json;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[JsonFormatter(typeof(DynamicResponseFormatter<ClusterStateResponse>))]
public class ClusterStateResponse : DynamicResponseBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

using System.Runtime.Serialization;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[DataContract]
public class ClusterIndicesStats
Expand Down
14 changes: 12 additions & 2 deletions src/OpenSearch.Client/Cluster/ClusterStats/ClusterNodesStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[DataContract]
public class ClusterNodesStats
Expand Down Expand Up @@ -200,7 +200,7 @@ public class ClusterOperatingSystemStats
public IReadOnlyCollection<ClusterOperatingSystemName> Names { get; internal set; }

[DataMember(Name = "pretty_names")]
public IReadOnlyCollection<ClusterOperatingSystemPrettyNane> PrettyNames { get; internal set; }
public IReadOnlyCollection<ClusterOperatingSystemPrettyName> PrettyNames { get; internal set; }

[DataMember(Name = "architectures")]
public IReadOnlyCollection<ArchitectureStats> Architectures { get; internal set; }
Expand Down Expand Up @@ -235,6 +235,16 @@ public class ClusterOperatingSystemName
public string Name { get; internal set; }
}

[DataContract]
public class ClusterOperatingSystemPrettyName
Yury-Fridlyand marked this conversation as resolved.
Show resolved Hide resolved
{
[DataMember(Name = "count")]
public int Count { get; internal set; }

[DataMember(Name = "pretty_name")]
public string PrettyName { get; internal set; }
}

[DataContract]
public class ClusterNodeCount
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* under the License.
*/

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[MapsApi("cluster.stats.json")]
public partial interface IClusterStatsRequest { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

using System.Runtime.Serialization;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
public class ClusterStatsResponse : NodesResponseBase
{
Expand Down
10 changes: 0 additions & 10 deletions src/OpenSearch.Client/Cluster/NodesInfo/NodeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,6 @@ public class NodeOperatingSystemInfo
public string Version { get; internal set; }
}

[DataContract]
public class ClusterOperatingSystemPrettyNane
{
[DataMember(Name = "count")]
public int Count { get; internal set; }

[DataMember(Name = "pretty_name")]
public string PrettyName { get; internal set; }
}

[DataContract]
public class NodeInfoOSCPU
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* under the License.
*/

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[MapsApi("cluster.remote_info.json")]
public partial interface IRemoteInfoRequest { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
using OpenSearch.Net;
using OpenSearch.Net.Utf8Json;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[DataContract]
[JsonFormatter(typeof(DictionaryResponseFormatter<RemoteInfoResponse, string, RemoteInfo>))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
using OpenSearch.Net;
using OpenSearch.Net.Specification.ClusterApi;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[MapsApi("cluster.delete_voting_config_exclusions")]
public partial interface IDeleteVotingConfigExclusionsRequest { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* under the License.
*/

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
public class DeleteVotingConfigExclusionsResponse : ResponseBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
using OpenSearch.Net;
using OpenSearch.Net.Specification.ClusterApi;

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
[MapsApi("cluster.post_voting_config_exclusions")]
public partial interface IPostVotingConfigExclusionsRequest { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* under the License.
*/

namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
public class PostVotingConfigExclusionsResponse : ResponseBase
{
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSearch.Client/Descriptors.Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
// ReSharper disable UnusedTypeParameter
// ReSharper disable PartialMethodWithSinglePart
// ReSharper disable RedundantNameQualifier
namespace OpenSearch.Client
namespace OpenSearch.Client.Specification.ClusterApi
{
///<summary>Descriptor for AllocationExplain <para>https://opensearch.org/docs/latest/opensearch/rest-api/cluster-allocation/</para></summary>
public partial class ClusterAllocationExplainDescriptor : RequestDescriptorBase<ClusterAllocationExplainDescriptor, ClusterAllocationExplainRequestParameters, IClusterAllocationExplainRequest>, IClusterAllocationExplainRequest
Expand Down
Loading