Skip to content

Commit

Permalink
Fix: backwards compatible parameter order in cluster stats.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Nov 25, 2024
1 parent ba444be commit 036f355
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions opensearchpy/_async/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ async def state(
)
async def stats(
self,
metric: Any = None,
index_metric: Any = None,
node_id: Any = None,
params: Any = None,
headers: Any = None,
metric: Any = None,
index_metric: Any = None,
) -> Any:
"""
Returns high-level overview of cluster statistics.
Expand Down
4 changes: 2 additions & 2 deletions opensearchpy/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ def state(
)
def stats(
self,
metric: Any = None,
index_metric: Any = None,
node_id: Any = None,
params: Any = None,
headers: Any = None,
metric: Any = None,
index_metric: Any = None,
) -> Any:
"""
Returns high-level overview of cluster statistics.
Expand Down
7 changes: 7 additions & 0 deletions utils/templates/overrides/cluster/stats
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{% extends "base" %}
{% block func_params %}
node_id: Any = None,
params: Any = None,
headers: Any = None,
metric: Any = None,
index_metric: Any = None,
{% endblock %}
{% block request %}
return await self.transport.perform_request("{{ api.method }}", "/_cluster/stats" if node_id in SKIP_IN_PATH else _make_path("_cluster", "stats", "nodes", node_id), params=params, headers=headers)
{% endblock%}
Expand Down

0 comments on commit 036f355

Please sign in to comment.