Skip to content

Commit 8e92b85

Browse files
authored
Update ES client API's for some missing 7 features (#949)
* Update cat.py to have correct query params * Add missing api remote_info and missing params * a couple apis have had added query params * Add Split api and add missing query params * Adding processor_grok api * Adding missing apis: * update by query rethrottle * scripts painless execute * scripts painless context * rank eval * delete by query rethrottle * add missing query params * Add missing xpack apis * Update helpers to account for 7.x scroll api
1 parent 206f5e2 commit 8e92b85

File tree

9 files changed

+283
-66
lines changed

9 files changed

+283
-66
lines changed

elasticsearch/client/__init__.py

+141-19
Large diffs are not rendered by default.

elasticsearch/client/cat.py

+8-15
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ def aliases(self, name=None, params=None):
2424
"GET", _make_path("_cat", "aliases", name), params=params
2525
)
2626

27-
@query_params(
28-
"bytes", "size", "format", "h", "help", "local", "master_timeout", "s", "v"
29-
)
27+
@query_params("bytes", "format", "h", "help", "local", "master_timeout", "s", "v")
3028
def allocation(self, node_id=None, params=None):
3129
"""
3230
Allocation provides a snapshot of how shards have located around the
@@ -52,7 +50,7 @@ def allocation(self, node_id=None, params=None):
5250
"GET", _make_path("_cat", "allocation", node_id), params=params
5351
)
5452

55-
@query_params("size", "format", "h", "help", "local", "master_timeout", "s", "v")
53+
@query_params("format", "h", "help", "local", "master_timeout", "s", "v")
5654
def count(self, index=None, params=None):
5755
"""
5856
Count provides quick access to the document count of the entire cluster,
@@ -111,7 +109,6 @@ def help(self, params=None):
111109

112110
@query_params(
113111
"bytes",
114-
"time",
115112
"size",
116113
"format",
117114
"h",
@@ -218,16 +215,7 @@ def recovery(self, index=None, params=None):
218215
)
219216

220217
@query_params(
221-
"bytes",
222-
"time",
223-
"size",
224-
"format",
225-
"h",
226-
"help",
227-
"local",
228-
"master_timeout",
229-
"s",
230-
"v",
218+
"bytes", "size", "format", "h", "help", "local", "master_timeout", "s", "v"
231219
)
232220
def shards(self, index=None, params=None):
233221
"""
@@ -442,6 +430,7 @@ def snapshots(self, repository, params=None):
442430
"h",
443431
"help",
444432
"nodes",
433+
"node_id",
445434
"parent_task_id",
446435
"s",
447436
"v",
@@ -458,6 +447,10 @@ def tasks(self, params=None):
458447
:arg h: Comma-separated list of column names to display
459448
:arg help: Return help information, default False
460449
:arg nodes: A comma-separated list of node IDs or names to limit the
450+
returned information; use `_local` to return information from the
451+
node you're connecting to, leave empty to get information from all
452+
nodes (used for older version of Elasticsearch)
453+
:arg node_id: A comma-separated list of node IDs or names to limit the
461454
returned information; use `_local` to return information from the
462455
node you're connecting to, leave empty to get information from all
463456
nodes

elasticsearch/client/cluster.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,27 @@
33

44
class ClusterClient(NamespacedClient):
55
@query_params(
6+
"expand_wildcards",
67
"level",
78
"local",
89
"master_timeout",
910
"timeout",
1011
"wait_for_active_shards",
1112
"wait_for_events",
13+
"wait_for_no_initializing_shards",
1214
"wait_for_no_relocating_shards",
1315
"wait_for_nodes",
1416
"wait_for_status",
15-
"wait_for_no_initializing_shards",
1617
)
1718
def health(self, index=None, params=None):
1819
"""
1920
Get a very simple status on the health of the cluster.
2021
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>`_
2122
2223
:arg index: Limit the information returned to a specific index
24+
:arg expand_wildcards: Whether to expand wildcard expression to concrete
25+
indices that are open, closed or both., default 'all', valid choices
26+
are: 'open', 'closed', 'none', 'all'
2327
:arg level: Specify the level of detail for returned information,
2428
default 'cluster', valid choices are: 'cluster', 'indices', 'shards'
2529
:arg local: Return local information, do not retrieve the state from
@@ -66,6 +70,8 @@ def pending_tasks(self, params=None):
6670
"ignore_unavailable",
6771
"local",
6872
"master_timeout",
73+
"wait_for_metadata_version",
74+
"wait_for_timeout",
6975
)
7076
def state(self, metric=None, index=None, params=None):
7177
"""
@@ -87,6 +93,10 @@ def state(self, metric=None, index=None, params=None):
8793
:arg local: Return local information, do not retrieve the state from
8894
master node (default: false)
8995
:arg master_timeout: Specify timeout for connection to master
96+
:arg wait_for_metadata_version: Wait for the metadata version to be
97+
equal or greater than the specified metadata version
98+
:arg wait_for_timeout: The maximum time to wait for
99+
wait_for_metadata_version before timing out
90100
"""
91101
if index and not metric:
92102
metric = "_all"
@@ -174,6 +184,13 @@ def put_settings(self, body=None, params=None):
174184
"PUT", "/_cluster/settings", params=params, body=body
175185
)
176186

187+
@query_params()
188+
def remote_info(self, params=None):
189+
"""
190+
`<http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html>`_
191+
"""
192+
return self.transport.perform_request("GET", "/_remote/info", params=params)
193+
177194
@query_params("include_disk_info", "include_yes_decisions")
178195
def allocation_explain(self, body=None, params=None):
179196
"""

0 commit comments

Comments
 (0)