Skip to content

Commit

Permalink
Re-generate cluster.stats
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Nov 21, 2023
1 parent 064b707 commit c8d327e
Show file tree
Hide file tree
Showing 13 changed files with 206 additions and 441 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.remote_info"),
new("cluster.reroute"),
new("cluster.state"),
new("cluster.stats"),

new("cluster.*_component_template"),

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 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}"});
internal static ApiUrls NoNamespaceDelete = new ApiUrls(new[]{"{index}/_doc/{id}"});
Expand Down
85 changes: 0 additions & 85 deletions src/OpenSearch.Client/Descriptors.Cluster.cs

This file was deleted.

87 changes: 0 additions & 87 deletions src/OpenSearch.Client/OpenSearchClient.Cluster.cs

This file was deleted.

105 changes: 0 additions & 105 deletions src/OpenSearch.Client/Requests.Cluster.cs

This file was deleted.

3 changes: 3 additions & 0 deletions src/OpenSearch.Client/_Generated/ApiUrlsLookup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ internal static partial class ApiUrlsLookups
}
);

internal static readonly ApiUrls ClusterStats =
new(new[] { "_cluster/stats", "_cluster/stats/nodes/{node_id}" });

internal static readonly ApiUrls NoNamespaceCreatePit =
new(new[] { "{index}/_search/point_in_time" });

Expand Down
36 changes: 36 additions & 0 deletions src/OpenSearch.Client/_Generated/Descriptors.Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -629,4 +629,40 @@ public ClusterStateDescriptor WaitForMetadataVersion(long? waitformetadataversio
public ClusterStateDescriptor WaitForTimeout(Time waitfortimeout) =>
Qs("wait_for_timeout", waitfortimeout);
}

/// <summary>Descriptor for Stats <para>https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/</para></summary>
public partial class ClusterStatsDescriptor
: RequestDescriptorBase<
ClusterStatsDescriptor,
ClusterStatsRequestParameters,
IClusterStatsRequest
>,
IClusterStatsRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.ClusterStats;

/// <summary>/_cluster/stats</summary>
public ClusterStatsDescriptor()
: base() { }

/// <summary>/_cluster/stats/nodes/{node_id}</summary>
/// <param name="nodeId">Optional, accepts null</param>
public ClusterStatsDescriptor(NodeIds nodeId)
: base(r => r.Optional("node_id", nodeId)) { }

// values part of the url path
NodeIds IClusterStatsRequest.NodeId => Self.RouteValues.Get<NodeIds>("node_id");

/// <summary>Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes.</summary>
public ClusterStatsDescriptor NodeId(NodeIds nodeId) =>
Assign(nodeId, (a, v) => a.RouteValues.Optional("node_id", v));

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

/// <summary>Operation timeout.</summary>
public ClusterStatsDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
}
}
45 changes: 45 additions & 0 deletions src/OpenSearch.Client/_Generated/OpenSearchClient.Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -781,5 +781,50 @@ public Task<ClusterStateResponse> StateAsync(
request.RequestParameters,
ct
);

/// <summary>
/// <c>GET</c> request to the <c>cluster.stats</c> API, read more about this API online:
/// <para></para>
/// <a href="https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/">https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/</a>
/// </summary>
public ClusterStatsResponse Stats(
Func<ClusterStatsDescriptor, IClusterStatsRequest> selector = null
) => Stats(selector.InvokeOrDefault(new ClusterStatsDescriptor()));

/// <summary>
/// <c>GET</c> request to the <c>cluster.stats</c> API, read more about this API online:
/// <para></para>
/// <a href="https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/">https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/</a>
/// </summary>
public Task<ClusterStatsResponse> StatsAsync(
Func<ClusterStatsDescriptor, IClusterStatsRequest> selector = null,
CancellationToken ct = default
) => StatsAsync(selector.InvokeOrDefault(new ClusterStatsDescriptor()), ct);

/// <summary>
/// <c>GET</c> request to the <c>cluster.stats</c> API, read more about this API online:
/// <para></para>
/// <a href="https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/">https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/</a>
/// </summary>
public ClusterStatsResponse Stats(IClusterStatsRequest request) =>
DoRequest<IClusterStatsRequest, ClusterStatsResponse>(
request,
request.RequestParameters
);

/// <summary>
/// <c>GET</c> request to the <c>cluster.stats</c> API, read more about this API online:
/// <para></para>
/// <a href="https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/">https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/</a>
/// </summary>
public Task<ClusterStatsResponse> StatsAsync(
IClusterStatsRequest request,
CancellationToken ct = default
) =>
DoRequestAsync<IClusterStatsRequest, ClusterStatsResponse>(
request,
request.RequestParameters,
ct
);
}
}
Loading

0 comments on commit c8d327e

Please sign in to comment.