open/close APIs

This commit is contained in:
Honza Kral
2013-07-24 03:47:28 +02:00
parent 4f839802a7
commit 477e5c2366
+26
View File
@@ -63,6 +63,32 @@ class IndicesClient(NamespacedClient):
status, data = self.transport.perform_request('PUT', _make_path(index), params=params, body=body)
return data
@query_params('timeout', 'master_timeout')
def open(self, index, params=None):
"""
The open and close index APIs allow to close an index, and later on opening it.
http://www.elasticsearch.org/guide/reference/api/admin-indices-open-close/
:arg index: The name of the index
:arg master_timeout: Specify timeout for connection to master
:arg timeout: Explicit operation timeout
"""
status, data = self.transport.perform_request('POST', _make_path(index, '_open'), params=params)
return data
@query_params('timeout', 'master_timeout')
def close(self, index, params=None):
"""
The open and close index APIs allow to close an index, and later on opening it.
http://www.elasticsearch.org/guide/reference/api/admin-indices-open-close/
:arg index: The name of the index
:arg master_timeout: Specify timeout for connection to master
:arg timeout: Explicit operation timeout
"""
status, data = self.transport.perform_request('POST', _make_path(index, '_close'), params=params)
return data
@query_params('timeout', 'master_timeout')
def delete(self, index=None, params=None):
"""