Skip to content

Commit 74cb686

Browse files
committed
Adding missing APIs
1 parent c305dc5 commit 74cb686

File tree

2 files changed

+65
-2
lines changed

2 files changed

+65
-2
lines changed

elasticsearch/client/cat.py

+35-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class CatClient(NamespacedClient):
44
@query_params('h', 'help', 'local', 'master_timeout', 'v')
55
def aliases(self, name=None, params=None):
66
"""
7-
7+
88
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-alias.html>`_
99
1010
:arg name: A comma-separated list of alias names to return
@@ -275,7 +275,7 @@ def fielddata(self, fields=None, params=None):
275275
@query_params('h', 'help', 'local', 'master_timeout', 'v')
276276
def plugins(self, params=None):
277277
"""
278-
278+
279279
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-plugins.html>`_
280280
281281
:arg h: Comma-separated list of column names to display
@@ -307,3 +307,36 @@ def nodeattrs(self, params=None):
307307
params=params)
308308
return data
309309

310+
@query_params('h', 'help', 'local', 'master_timeout', 'v')
311+
def repositories(self, params=None):
312+
"""
313+
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-repositories.html>`_
314+
315+
:arg h: Comma-separated list of column names to display
316+
:arg help: Return help information, default False
317+
:arg local: Return local information, do not retrieve the state from
318+
master node, default False
319+
:arg master_timeout: Explicit operation timeout for connection to master
320+
node
321+
:arg v: Verbose mode. Display column headers, default False
322+
"""
323+
_, data = self.transport.perform_request('GET', '/_cat/repositories',
324+
params=params)
325+
return data
326+
327+
@query_params('h', 'help', 'master_timeout', 'v')
328+
def snapshots(self, repository=None, params=None):
329+
"""
330+
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-snapshots.html>`_
331+
332+
:arg repository: Name of repository from which to fetch the snapshot
333+
information
334+
:arg h: Comma-separated list of column names to display
335+
:arg help: Return help information, default False
336+
:arg master_timeout: Explicit operation timeout for connection to master
337+
node
338+
:arg v: Verbose mode. Display column headers, default False
339+
"""
340+
_, data = self.transport.perform_request('GET', _make_path('_cat',
341+
'snapshots', repository), params=params)
342+
return data

elasticsearch/client/indices.py

+30
Original file line numberDiff line numberDiff line change
@@ -966,3 +966,33 @@ def shard_stores(self, index=None, params=None):
966966
'_shard_stores'), params=params)
967967
return data
968968

969+
@query_params('allow_no_indices', 'expand_wildcards', 'flush',
970+
'ignore_unavailable', 'max_num_segments', 'only_expunge_deletes',
971+
'operation_threading', 'wait_for_merge')
972+
def forcemerge(self, index=None, params=None):
973+
"""
974+
`<http://www.elastic.co/guide/en/elasticsearch/reference/2.1/indices-forcemerge.html>`_
975+
976+
:arg index: A comma-separated list of index names; use `_all` or empty
977+
string to perform the operation on all indices
978+
:arg allow_no_indices: Whether to ignore if a wildcard indices
979+
expression resolves into no concrete indices. (This includes `_all`
980+
string or when no indices have been specified)
981+
:arg expand_wildcards: Whether to expand wildcard expression to concrete
982+
indices that are open, closed or both., default 'open', valid
983+
choices are: 'open', 'closed', 'none', 'all'
984+
:arg flush: Specify whether the index should be flushed after performing
985+
the operation (default: true)
986+
:arg ignore_unavailable: Whether specified concrete indices should be
987+
ignored when unavailable (missing or closed)
988+
:arg max_num_segments: The number of segments the index should be merged
989+
into (default: dynamic)
990+
:arg only_expunge_deletes: Specify whether the operation should only
991+
expunge deleted documents
992+
:arg operation_threading: TODO: ?
993+
:arg wait_for_merge: Specify whether the request should block until the
994+
merge process is finished (default: true)
995+
"""
996+
_, data = self.transport.perform_request('POST', _make_path(index,
997+
'_forcemerge'), params=params)
998+
return data

0 commit comments

Comments
 (0)