Skip to content

Commit 39ada11

Browse files
nfsechonzakral
authored andcommitted
HTTP 405 when node_id is defined
_make_path encodes "/" - so the request looks like: GET /_cluster%2Fstats%2Fnodes/node_id and elastic returns a 405 error.
1 parent 8f5c60f commit 39ada11

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

elasticsearch/client/cluster.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,15 @@ def stats(self, node_id=None, params=None):
114114
115115
:arg node_id: A comma-separated list of node IDs or names to limit the
116116
returned information; use `_local` to return information from the
117-
node you're connecting to, leave empty to get information from all
117+
node you're connecting to, `_master` to return information from the
118+
currently-elected master node or leave empty to get information from all
118119
nodes
119120
:arg flat_settings: Return settings in flat format (default: false)
120121
:arg timeout: Explicit operation timeout
121122
"""
122123
url = "/_cluster/stats"
123124
if node_id:
124-
url = _make_path("_cluster/stats/nodes", node_id)
125+
url = _make_path("_cluster","stats","nodes", node_id)
125126
return self.transport.perform_request("GET", url, params=params)
126127

127128
@query_params(

0 commit comments

Comments
 (0)