Adding missing APIs

This commit is contained in:
Honza Král
2015-12-08 22:19:32 +01:00
parent c305dc5587
commit 74cb686538
2 changed files with 65 additions and 2 deletions
+35 -2
View File
@@ -4,7 +4,7 @@ class CatClient(NamespacedClient):
@query_params('h', 'help', 'local', 'master_timeout', 'v')
def aliases(self, name=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-alias.html>`_
:arg name: A comma-separated list of alias names to return
@@ -275,7 +275,7 @@ class CatClient(NamespacedClient):
@query_params('h', 'help', 'local', 'master_timeout', 'v')
def plugins(self, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-plugins.html>`_
:arg h: Comma-separated list of column names to display
@@ -307,3 +307,36 @@ class CatClient(NamespacedClient):
params=params)
return data
@query_params('h', 'help', 'local', 'master_timeout', 'v')
def repositories(self, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-repositories.html>`_
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node, default False
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg v: Verbose mode. Display column headers, default False
"""
_, data = self.transport.perform_request('GET', '/_cat/repositories',
params=params)
return data
@query_params('h', 'help', 'master_timeout', 'v')
def snapshots(self, repository=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-snapshots.html>`_
:arg repository: Name of repository from which to fetch the snapshot
information
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg v: Verbose mode. Display column headers, default False
"""
_, data = self.transport.perform_request('GET', _make_path('_cat',
'snapshots', repository), params=params)
return data
+30
View File
@@ -966,3 +966,33 @@ class IndicesClient(NamespacedClient):
'_shard_stores'), params=params)
return data
@query_params('allow_no_indices', 'expand_wildcards', 'flush',
'ignore_unavailable', 'max_num_segments', 'only_expunge_deletes',
'operation_threading', 'wait_for_merge')
def forcemerge(self, index=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/2.1/indices-forcemerge.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg allow_no_indices: Whether to ignore if a wildcard indices
expression resolves into no concrete indices. (This includes `_all`
string or when no indices have been specified)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg flush: Specify whether the index should be flushed after performing
the operation (default: true)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg max_num_segments: The number of segments the index should be merged
into (default: dynamic)
:arg only_expunge_deletes: Specify whether the operation should only
expunge deleted documents
:arg operation_threading: TODO: ?
:arg wait_for_merge: Specify whether the request should block until the
merge process is finished (default: true)
"""
_, data = self.transport.perform_request('POST', _make_path(index,
'_forcemerge'), params=params)
return data