open/close APIs
This commit is contained in:
@@ -63,6 +63,32 @@ class IndicesClient(NamespacedClient):
|
|||||||
status, data = self.transport.perform_request('PUT', _make_path(index), params=params, body=body)
|
status, data = self.transport.perform_request('PUT', _make_path(index), params=params, body=body)
|
||||||
return data
|
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')
|
@query_params('timeout', 'master_timeout')
|
||||||
def delete(self, index=None, params=None):
|
def delete(self, index=None, params=None):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user