Skip to content

Commit

Permalink
Re-generate cluster.state
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Oct 4, 2023
1 parent ce0dbc8 commit b87be1b
Show file tree
Hide file tree
Showing 15 changed files with 490 additions and 353 deletions.
1 change: 1 addition & 0 deletions src/ApiGenerator/Configuration/CodeConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public static class CodeConfiguration
new("cluster.put_settings"),
new("cluster.remote_info"),
new("cluster.reroute"),
new("cluster.state"),

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 ClusterState = new ApiUrls(new[]{"_cluster/state", "_cluster/state/{metric}", "_cluster/state/{metric}/{index}"});
internal static ApiUrls ClusterStats = new ApiUrls(new[]{"_cluster/stats", "_cluster/stats/nodes/{node_id}"});
internal static ApiUrls NoNamespaceCount = new ApiUrls(new[]{"_count", "{index}/_count"});
internal static ApiUrls NoNamespaceCreate = new ApiUrls(new[]{"{index}/_create/{id}"});
Expand Down
57 changes: 0 additions & 57 deletions src/OpenSearch.Client/Descriptors.Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,63 +57,6 @@
// ReSharper disable RedundantNameQualifier
namespace OpenSearch.Client.Specification.ClusterApi
{
///<summary>Descriptor for State <para></para></summary>
public partial class ClusterStateDescriptor : RequestDescriptorBase<ClusterStateDescriptor, ClusterStateRequestParameters, IClusterStateRequest>, IClusterStateRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterState;
///<summary>/_cluster/state</summary>
public ClusterStateDescriptor(): base()
{
}

///<summary>/_cluster/state/{metric}</summary>
///<param name = "metric">Optional, accepts null</param>
public ClusterStateDescriptor(Metrics metric): base(r => r.Optional("metric", metric))
{
}

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

// values part of the url path
Metrics IClusterStateRequest.Metric => Self.RouteValues.Get<Metrics>("metric");
Indices IClusterStateRequest.Index => Self.RouteValues.Get<Indices>("index");
///<summary>Limit the information returned to the specified metrics</summary>
public ClusterStateDescriptor Metric(Metrics metric) => Assign(metric, (a, v) => a.RouteValues.Optional("metric", v));
///<summary>A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices</summary>
public ClusterStateDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v));
///<summary>a shortcut into calling Index(typeof(TOther))</summary>
public ClusterStateDescriptor 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 ClusterStateDescriptor AllIndices() => Index(Indices.All);
// Request parameters
///<summary>Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)</summary>
public ClusterStateDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices);
///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
public ClusterStateDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards);
///<summary>Return settings in flat format (default: false)</summary>
public ClusterStateDescriptor FlatSettings(bool? flatsettings = true) => Qs("flat_settings", flatsettings);
///<summary>Whether specified concrete indices should be ignored when unavailable (missing or closed)</summary>
public ClusterStateDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable);
///<summary>Return local information, do not retrieve the state from cluster_manager node (default: false)</summary>
public ClusterStateDescriptor 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 ClusterStateDescriptor 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 ClusterStateDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout);
///<summary>Wait for the metadata version to be equal or greater than the specified metadata version</summary>
public ClusterStateDescriptor WaitForMetadataVersion(long? waitformetadataversion) => Qs("wait_for_metadata_version", waitformetadataversion);
///<summary>The maximum time to wait for wait_for_metadata_version before timing out</summary>
public ClusterStateDescriptor WaitForTimeout(Time waitfortimeout) => Qs("wait_for_timeout", waitfortimeout);
}

///<summary>Descriptor for Stats <para></para></summary>
public partial class ClusterStatsDescriptor : RequestDescriptorBase<ClusterStatsDescriptor, ClusterStatsRequestParameters, IClusterStatsRequest>, IClusterStatsRequest
{
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.state</c> API, read more about this API online:
/// <para></para>
/// <a href = ""></a>
/// </summary>
public ClusterStateResponse State(Indices index = null, Func<ClusterStateDescriptor, IClusterStateRequest> selector = null) => State(selector.InvokeOrDefault(new ClusterStateDescriptor().Index(index: index)));
/// <summary>
/// <c>GET</c> request to the <c>cluster.state</c> API, read more about this API online:
/// <para></para>
/// <a href = ""></a>
/// </summary>
public Task<ClusterStateResponse> StateAsync(Indices index = null, Func<ClusterStateDescriptor, IClusterStateRequest> selector = null, CancellationToken ct = default) => StateAsync(selector.InvokeOrDefault(new ClusterStateDescriptor().Index(index: index)), ct);
/// <summary>
/// <c>GET</c> request to the <c>cluster.state</c> API, read more about this API online:
/// <para></para>
/// <a href = ""></a>
/// </summary>
public ClusterStateResponse State(IClusterStateRequest request) => DoRequest<IClusterStateRequest, ClusterStateResponse>(request, request.RequestParameters);
/// <summary>
/// <c>GET</c> request to the <c>cluster.state</c> API, read more about this API online:
/// <para></para>
/// <a href = ""></a>
/// </summary>
public Task<ClusterStateResponse> StateAsync(IClusterStateRequest request, CancellationToken ct = default) => DoRequestAsync<IClusterStateRequest, ClusterStateResponse>(request, request.RequestParameters, ct);
/// <summary>
/// <c>GET</c> request to the <c>cluster.stats</c> API, read more about this API online:
/// <para></para>
Expand Down
114 changes: 0 additions & 114 deletions src/OpenSearch.Client/Requests.Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,120 +58,6 @@
// ReSharper disable RedundantNameQualifier
namespace OpenSearch.Client.Specification.ClusterApi
{
[InterfaceDataContract]
public partial interface IClusterStateRequest : IRequest<ClusterStateRequestParameters>
{
[IgnoreDataMember]
Metrics Metric
{
get;
}

[IgnoreDataMember]
Indices Index
{
get;
}
}

///<summary>Request for State <para></para></summary>
public partial class ClusterStateRequest : PlainRequestBase<ClusterStateRequestParameters>, IClusterStateRequest
{
protected IClusterStateRequest Self => this;
internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterState;
///<summary>/_cluster/state</summary>
public ClusterStateRequest(): base()
{
}

///<summary>/_cluster/state/{metric}</summary>
///<param name = "metric">Optional, accepts null</param>
public ClusterStateRequest(Metrics metric): base(r => r.Optional("metric", metric))
{
}

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

// values part of the url path
[IgnoreDataMember]
Metrics IClusterStateRequest.Metric => Self.RouteValues.Get<Metrics>("metric");
[IgnoreDataMember]
Indices IClusterStateRequest.Index => Self.RouteValues.Get<Indices>("index");
// Request parameters
///<summary>
/// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have
/// been specified)
///</summary>
public bool? AllowNoIndices
{
get => Q<bool? >("allow_no_indices");
set => Q("allow_no_indices", value);
}

///<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>Return settings in flat format (default: false)</summary>
public bool? FlatSettings
{
get => Q<bool? >("flat_settings");
set => Q("flat_settings", value);
}

///<summary>Whether specified concrete indices should be ignored when unavailable (missing or closed)</summary>
public bool? IgnoreUnavailable
{
get => Q<bool? >("ignore_unavailable");
set => Q("ignore_unavailable", 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>Specify 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>Specify 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>Wait for the metadata version to be equal or greater than the specified metadata version</summary>
public long? WaitForMetadataVersion
{
get => Q<long? >("wait_for_metadata_version");
set => Q("wait_for_metadata_version", value);
}

///<summary>The maximum time to wait for wait_for_metadata_version before timing out</summary>
public Time WaitForTimeout
{
get => Q<Time>("wait_for_timeout");
set => Q("wait_for_timeout", value);
}
}

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

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

internal static readonly ApiUrls ClusterState =
new(
new[]
{
"_cluster/state",
"_cluster/state/{metric}",
"_cluster/state/{metric}/{index}"
}
);

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

Expand Down
87 changes: 87 additions & 0 deletions src/OpenSearch.Client/_Generated/Descriptors.Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -376,4 +376,91 @@ public ClusterRerouteDescriptor RetryFailed(bool? retryfailed = true) =>
///<summary>Operation timeout.</summary>
public ClusterRerouteDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
}

///<summary>Descriptor for State <para>https://opensearch.org/docs/latest</para></summary>
public partial class ClusterStateDescriptor
: RequestDescriptorBase<
ClusterStateDescriptor,
ClusterStateRequestParameters,
IClusterStateRequest
>,
IClusterStateRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterState;

///<summary>/_cluster/state</summary>
public ClusterStateDescriptor()
: base() { }

///<summary>/_cluster/state/{metric}</summary>
///<param name="metric">Optional, accepts null</param>
public ClusterStateDescriptor(Metrics metric)
: base(r => r.Optional("metric", metric)) { }

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

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

///<summary>Comma-separated list of indices; use the special string `_all` or Indices.All to perform the operation on all indices.</summary>
public ClusterStateDescriptor Index(Indices index) =>
Assign(index, (a, v) => a.RouteValues.Optional("index", v));

///<summary>a shortcut into calling Index(typeof(TOther))</summary>
public ClusterStateDescriptor 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 ClusterStateDescriptor AllIndices() => Index(Indices.All);

///<summary>Limit the information returned to the specified metrics.</summary>
public ClusterStateDescriptor Metric(Metrics metric) =>
Assign(metric, (a, v) => a.RouteValues.Optional("metric", v));

// Request parameters
///<summary>Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).</summary>
public ClusterStateDescriptor AllowNoIndices(bool? allownoindices = true) =>
Qs("allow_no_indices", allownoindices);

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

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

///<summary>Return settings in flat format.</summary>
public ClusterStateDescriptor FlatSettings(bool? flatsettings = true) =>
Qs("flat_settings", flatsettings);

///<summary>Whether specified concrete indices should be ignored when unavailable (missing or closed).</summary>
public ClusterStateDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) =>
Qs("ignore_unavailable", ignoreunavailable);

///<summary>Return local information, do not retrieve the state from cluster-manager node.</summary>
public ClusterStateDescriptor 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 ClusterStateDescriptor MasterTimeout(Time mastertimeout) =>
Qs("master_timeout", mastertimeout);

///<summary>Wait for the metadata version to be equal or greater than the specified metadata version.</summary>
public ClusterStateDescriptor WaitForMetadataVersion(long? waitformetadataversion) =>
Qs("wait_for_metadata_version", waitformetadataversion);

///<summary>The maximum time to wait for wait_for_metadata_version before timing out.</summary>
public ClusterStateDescriptor WaitForTimeout(Time waitfortimeout) =>
Qs("wait_for_timeout", waitfortimeout);
}
}
51 changes: 51 additions & 0 deletions src/OpenSearch.Client/_Generated/OpenSearchClient.Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,5 +506,56 @@ public Task<ClusterRerouteResponse> RerouteAsync(
request.RequestParameters,
ct
);

/// <summary>
/// <c>GET</c> request to the <c>cluster.state</c> API, read more about this API online:
/// <para></para>
/// <a href="https://opensearch.org/docs/latest">https://opensearch.org/docs/latest</a>
/// </summary>
public ClusterStateResponse State(
Indices index = null,
Func<ClusterStateDescriptor, IClusterStateRequest> selector = null
) => State(selector.InvokeOrDefault(new ClusterStateDescriptor().Index(index: index)));

/// <summary>
/// <c>GET</c> request to the <c>cluster.state</c> API, read more about this API online:
/// <para></para>
/// <a href="https://opensearch.org/docs/latest">https://opensearch.org/docs/latest</a>
/// </summary>
public Task<ClusterStateResponse> StateAsync(
Indices index = null,
Func<ClusterStateDescriptor, IClusterStateRequest> selector = null,
CancellationToken ct = default
) =>
StateAsync(
selector.InvokeOrDefault(new ClusterStateDescriptor().Index(index: index)),
ct
);

/// <summary>
/// <c>GET</c> request to the <c>cluster.state</c> API, read more about this API online:
/// <para></para>
/// <a href="https://opensearch.org/docs/latest">https://opensearch.org/docs/latest</a>
/// </summary>
public ClusterStateResponse State(IClusterStateRequest request) =>
DoRequest<IClusterStateRequest, ClusterStateResponse>(
request,
request.RequestParameters
);

/// <summary>
/// <c>GET</c> request to the <c>cluster.state</c> API, read more about this API online:
/// <para></para>
/// <a href="https://opensearch.org/docs/latest">https://opensearch.org/docs/latest</a>
/// </summary>
public Task<ClusterStateResponse> StateAsync(
IClusterStateRequest request,
CancellationToken ct = default
) =>
DoRequestAsync<IClusterStateRequest, ClusterStateResponse>(
request,
request.RequestParameters,
ct
);
}
}
Loading

0 comments on commit b87be1b

Please sign in to comment.