Skip to content

Commit

Permalink
Re-generate cluster.health
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Sep 7, 2023
1 parent aee800b commit a1f1174
Show file tree
Hide file tree
Showing 16 changed files with 614 additions and 410 deletions.
1 change: 1 addition & 0 deletions src/ApiGenerator/Configuration/CodeConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public static class CodeConfiguration
new("cluster.exists_component_template"),
new("cluster.get_component_template"),
new("cluster.get_settings"),
new("cluster.health"),

new("dangling_indices.*"),
new("ingest.*"),
Expand Down
1 change: 0 additions & 1 deletion src/OpenSearch.Client/ApiUrlsLookup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ internal static partial class ApiUrlsLookups
internal static ApiUrls CatTemplates = new ApiUrls(new[]{"_cat/templates", "_cat/templates/{name}"});
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 ClusterHealth = new ApiUrls(new[]{"_cluster/health", "_cluster/health/{index}"});
internal static ApiUrls ClusterPendingTasks = new ApiUrls(new[]{"_cluster/pending_tasks"});
internal static ApiUrls ClusterPostVotingConfigExclusions = new ApiUrls(new[]{"_cluster/voting_config_exclusions"});
internal static ApiUrls ClusterPutSettings = new ApiUrls(new[]{"_cluster/settings"});
Expand Down
53 changes: 0 additions & 53 deletions src/OpenSearch.Client/Descriptors.Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,59 +57,6 @@
// ReSharper disable RedundantNameQualifier
namespace OpenSearch.Client.Specification.ClusterApi
{
///<summary>Descriptor for Health <para>https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/</para></summary>
public partial class ClusterHealthDescriptor : RequestDescriptorBase<ClusterHealthDescriptor, ClusterHealthRequestParameters, IClusterHealthRequest>, IClusterHealthRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterHealth;
///<summary>/_cluster/health</summary>
public ClusterHealthDescriptor(): base()
{
}

///<summary>/_cluster/health/{index}</summary>
///<param name = "index">Optional, accepts null</param>
public ClusterHealthDescriptor(Indices index): base(r => r.Optional("index", index))
{
}

// values part of the url path
Indices IClusterHealthRequest.Index => Self.RouteValues.Get<Indices>("index");
///<summary>Limit the information returned to a specific index</summary>
public ClusterHealthDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v));
///<summary>a shortcut into calling Index(typeof(TOther))</summary>
public ClusterHealthDescriptor Index<TOther>()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v));
///<summary>A shortcut into calling Index(Indices.All)</summary>
public ClusterHealthDescriptor AllIndices() => Index(Indices.All);
// Request parameters
///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
public ClusterHealthDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards);
///<summary>Specify the level of detail for returned information</summary>
public ClusterHealthDescriptor Level(Level? level) => Qs("level", level);
///<summary>Return local information, do not retrieve the state from cluster_manager node (default: false)</summary>
public ClusterHealthDescriptor Local(bool? local = true) => Qs("local", local);
///<summary>Explicit operation timeout for connection to master node</summary>
///<remarks>Deprecated as of OpenSearch 2.0, use <see cref="ClusterManagerTimeout"/> instead</remarks>
public ClusterHealthDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout);
///<summary>Explicit operation timeout for connection to cluster_manager node</summary>
///<remarks>Introduced in OpenSearch 2.0 instead of <see cref="MasterTimeout"/></remarks>
public ClusterHealthDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout);
///<summary>Explicit operation timeout</summary>
public ClusterHealthDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
///<summary>Wait until the specified number of shards is active</summary>
public ClusterHealthDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards);
///<summary>Wait until all currently queued events with the given priority are processed</summary>
public ClusterHealthDescriptor WaitForEvents(WaitForEvents? waitforevents) => Qs("wait_for_events", waitforevents);
///<summary>Whether to wait until there are no initializing shards in the cluster</summary>
public ClusterHealthDescriptor WaitForNoInitializingShards(bool? waitfornoinitializingshards = true) => Qs("wait_for_no_initializing_shards", waitfornoinitializingshards);
///<summary>Whether to wait until there are no relocating shards in the cluster</summary>
public ClusterHealthDescriptor WaitForNoRelocatingShards(bool? waitfornorelocatingshards = true) => Qs("wait_for_no_relocating_shards", waitfornorelocatingshards);
///<summary>Wait until the specified number of nodes is available</summary>
public ClusterHealthDescriptor WaitForNodes(string waitfornodes) => Qs("wait_for_nodes", waitfornodes);
///<summary>Wait until cluster is in a specific state</summary>
public ClusterHealthDescriptor WaitForStatus(WaitForStatus? waitforstatus) => Qs("wait_for_status", waitforstatus);
}

///<summary>Descriptor for PendingTasks <para>https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-pending-tasks/</para></summary>
public partial class ClusterPendingTasksDescriptor : RequestDescriptorBase<ClusterPendingTasksDescriptor, ClusterPendingTasksRequestParameters, IClusterPendingTasksRequest>, IClusterPendingTasksRequest
{
Expand Down
24 changes: 0 additions & 24 deletions src/OpenSearch.Client/OpenSearchClient.Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,30 +59,6 @@ namespace OpenSearch.Client.Specification.ClusterApi
///</summary>
public partial class ClusterNamespace : NamespacedClientProxy
{
/// <summary>
/// <c>GET</c> request to the <c>cluster.health</c> API, read more about this API online:
/// <para></para>
/// <a href = "https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/">https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/</a>
/// </summary>
public ClusterHealthResponse Health(Indices index = null, Func<ClusterHealthDescriptor, IClusterHealthRequest> selector = null) => Health(selector.InvokeOrDefault(new ClusterHealthDescriptor().Index(index: index)));
/// <summary>
/// <c>GET</c> request to the <c>cluster.health</c> API, read more about this API online:
/// <para></para>
/// <a href = "https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/">https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/</a>
/// </summary>
public Task<ClusterHealthResponse> HealthAsync(Indices index = null, Func<ClusterHealthDescriptor, IClusterHealthRequest> selector = null, CancellationToken ct = default) => HealthAsync(selector.InvokeOrDefault(new ClusterHealthDescriptor().Index(index: index)), ct);
/// <summary>
/// <c>GET</c> request to the <c>cluster.health</c> API, read more about this API online:
/// <para></para>
/// <a href = "https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/">https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/</a>
/// </summary>
public ClusterHealthResponse Health(IClusterHealthRequest request) => DoRequest<IClusterHealthRequest, ClusterHealthResponse>(request, request.RequestParameters);
/// <summary>
/// <c>GET</c> request to the <c>cluster.health</c> API, read more about this API online:
/// <para></para>
/// <a href = "https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/">https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/</a>
/// </summary>
public Task<ClusterHealthResponse> HealthAsync(IClusterHealthRequest request, CancellationToken ct = default) => DoRequestAsync<IClusterHealthRequest, ClusterHealthResponse>(request, request.RequestParameters, ct);
/// <summary>
/// <c>GET</c> request to the <c>cluster.pending_tasks</c> API, read more about this API online:
/// <para></para>
Expand Down
117 changes: 0 additions & 117 deletions src/OpenSearch.Client/Requests.Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,123 +58,6 @@
// ReSharper disable RedundantNameQualifier
namespace OpenSearch.Client.Specification.ClusterApi
{
[InterfaceDataContract]
public partial interface IClusterHealthRequest : IRequest<ClusterHealthRequestParameters>
{
[IgnoreDataMember]
Indices Index
{
get;
}
}

///<summary>Request for Health <para>https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/</para></summary>
public partial class ClusterHealthRequest : PlainRequestBase<ClusterHealthRequestParameters>, IClusterHealthRequest
{
protected IClusterHealthRequest Self => this;
internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterHealth;
///<summary>/_cluster/health</summary>
public ClusterHealthRequest(): base()
{
}

///<summary>/_cluster/health/{index}</summary>
///<param name = "index">Optional, accepts null</param>
public ClusterHealthRequest(Indices index): base(r => r.Optional("index", index))
{
}

// values part of the url path
[IgnoreDataMember]
Indices IClusterHealthRequest.Index => Self.RouteValues.Get<Indices>("index");
// Request parameters
///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
public ExpandWildcards? ExpandWildcards
{
get => Q<ExpandWildcards? >("expand_wildcards");
set => Q("expand_wildcards", value);
}

///<summary>Specify the level of detail for returned information</summary>
public Level? Level
{
get => Q<Level? >("level");
set => Q("level", value);
}

///<summary>Return local information, do not retrieve the state from cluster_manager node (default: false)</summary>
public bool? Local
{
get => Q<bool? >("local");
set => Q("local", value);
}

///<summary>Explicit operation timeout for connection to master node</summary>
///<remarks>Deprecated as of OpenSearch 2.0, use <see cref="ClusterManagerTimeout"/> instead</remarks>
public Time MasterTimeout
{
get => Q<Time>("master_timeout");
set => Q("master_timeout", value);
}

///<summary>Explicit operation timeout for connection to cluster_manager node</summary>
///<remarks>Introduced in OpenSearch 2.0 instead of <see cref="MasterTimeout"/></remarks>
public Time ClusterManagerTimeout
{
get => Q<Time>("cluster_manager_timeout");
set => Q("cluster_manager_timeout", value);
}

///<summary>Explicit operation timeout</summary>
public Time Timeout
{
get => Q<Time>("timeout");
set => Q("timeout", value);
}

///<summary>Wait until the specified number of shards is active</summary>
public string WaitForActiveShards
{
get => Q<string>("wait_for_active_shards");
set => Q("wait_for_active_shards", value);
}

///<summary>Wait until all currently queued events with the given priority are processed</summary>
public WaitForEvents? WaitForEvents
{
get => Q<WaitForEvents? >("wait_for_events");
set => Q("wait_for_events", value);
}

///<summary>Whether to wait until there are no initializing shards in the cluster</summary>
public bool? WaitForNoInitializingShards
{
get => Q<bool? >("wait_for_no_initializing_shards");
set => Q("wait_for_no_initializing_shards", value);
}

///<summary>Whether to wait until there are no relocating shards in the cluster</summary>
public bool? WaitForNoRelocatingShards
{
get => Q<bool? >("wait_for_no_relocating_shards");
set => Q("wait_for_no_relocating_shards", value);
}

///<summary>Wait until the specified number of nodes is available</summary>
public string WaitForNodes
{
get => Q<string>("wait_for_nodes");
set => Q("wait_for_nodes", value);
}

///<summary>Wait until cluster is in a specific state</summary>
public WaitForStatus? WaitForStatus
{
get => Q<WaitForStatus? >("wait_for_status");
set => Q("wait_for_status", value);
}
}

[InterfaceDataContract]
public partial interface IClusterPendingTasksRequest : IRequest<ClusterPendingTasksRequestParameters>
{
Expand Down
3 changes: 3 additions & 0 deletions src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ internal static partial class ApiUrlsLookups

internal static readonly ApiUrls ClusterGetSettings = new(new[] { "_cluster/settings" });

internal static readonly ApiUrls ClusterHealth =
new(new[] { "_cluster/health", "_cluster/health/{index}" });

internal static readonly ApiUrls DanglingIndicesDeleteDanglingIndex =
new(new[] { "_dangling/{index_uuid}" });

Expand Down
98 changes: 98 additions & 0 deletions src/OpenSearch.Client/_Generated/Descriptors.Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,102 @@ public ClusterGetSettingsDescriptor MasterTimeout(Time mastertimeout) =>
///<summary>Operation timeout.</summary>
public ClusterGetSettingsDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
}

///<summary>Descriptor for Health <para>https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-health/</para></summary>
public partial class ClusterHealthDescriptor
: RequestDescriptorBase<
ClusterHealthDescriptor,
ClusterHealthRequestParameters,
IClusterHealthRequest
>,
IClusterHealthRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterHealth;

///<summary>/_cluster/health</summary>
public ClusterHealthDescriptor()
: base() { }

///<summary>/_cluster/health/{index}</summary>
///<param name="index">Optional, accepts null</param>
public ClusterHealthDescriptor(Indices index)
: base(r => r.Optional("index", index)) { }

// values part of the url path
Indices IClusterHealthRequest.Index => Self.RouteValues.Get<Indices>("index");

///<summary>Limit the information returned to specific indicies.</summary>
public ClusterHealthDescriptor Index(Indices index) =>
Assign(index, (a, v) => a.RouteValues.Optional("index", v));

///<summary>a shortcut into calling Index(typeof(TOther))</summary>
public ClusterHealthDescriptor Index<TOther>()
where TOther : class =>
Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v));

///<summary>A shortcut into calling Index(Indices.All)</summary>
public ClusterHealthDescriptor AllIndices() => Index(Indices.All);

// Request parameters
///<summary>The awareness attribute for which the health is required.</summary>
public ClusterHealthDescriptor AwarenessAttribute(string awarenessattribute) =>
Qs("awareness_attribute", awarenessattribute);

///<summary>Specify the level of detail for returned information.</summary>
public ClusterHealthDescriptor ClusterHealthLevel(ClusterHealthLevel? clusterhealthlevel) =>
Qs("level", clusterhealthlevel);

///<summary>Operation timeout for connection to cluster-manager node.</summary>
///<remarks>Supported by OpenSearch servers of version 2.0.0 or greater.</remarks>
public ClusterHealthDescriptor ClusterManagerTimeout(Time clustermanagertimeout) =>
Qs("cluster_manager_timeout", clustermanagertimeout);

///<summary>Checks whether local node is commissioned or not. If set to true on a local call it will throw exception if node is decommissioned.</summary>
public ClusterHealthDescriptor EnsureNodeCommissioned(
bool? ensurenodecommissioned = true
) => Qs("ensure_node_commissioned", ensurenodecommissioned);

///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
public ClusterHealthDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) =>
Qs("expand_wildcards", expandwildcards);

///<summary>Return local information, do not retrieve the state from cluster-manager node.</summary>
public ClusterHealthDescriptor Local(bool? local = true) => Qs("local", local);

///<summary>Operation timeout for connection to master node.</summary>
[Obsolete(
"Deprecated as of: 2.0.0, reason: To promote inclusive language, use 'cluster_manager_timeout' instead."
)]
public ClusterHealthDescriptor MasterTimeout(Time mastertimeout) =>
Qs("master_timeout", mastertimeout);

///<summary>Operation timeout.</summary>
public ClusterHealthDescriptor Timeout(Time timeout) => Qs("timeout", timeout);

///<summary>Wait until the specified number of shards is active.</summary>
public ClusterHealthDescriptor WaitForActiveShards(string waitforactiveshards) =>
Qs("wait_for_active_shards", waitforactiveshards);

///<summary>Wait until all currently queued events with the given priority are processed.</summary>
public ClusterHealthDescriptor WaitForEvents(WaitForEvents? waitforevents) =>
Qs("wait_for_events", waitforevents);

///<summary>Wait until the specified number of nodes is available.</summary>
public ClusterHealthDescriptor WaitForNodes(string waitfornodes) =>
Qs("wait_for_nodes", waitfornodes);

///<summary>Whether to wait until there are no initializing shards in the cluster.</summary>
public ClusterHealthDescriptor WaitForNoInitializingShards(
bool? waitfornoinitializingshards = true
) => Qs("wait_for_no_initializing_shards", waitfornoinitializingshards);

///<summary>Whether to wait until there are no relocating shards in the cluster.</summary>
public ClusterHealthDescriptor WaitForNoRelocatingShards(
bool? waitfornorelocatingshards = true
) => Qs("wait_for_no_relocating_shards", waitfornorelocatingshards);

///<summary>Wait until cluster is in a specific state.</summary>
public ClusterHealthDescriptor WaitForStatus(WaitForStatus? waitforstatus) =>
Qs("wait_for_status", waitforstatus);
}
}
Loading

0 comments on commit a1f1174

Please sign in to comment.