updated cluster.state API
This commit is contained in:
@@ -35,25 +35,24 @@ class ClusterClient(NamespacedClient):
|
|||||||
params=params)
|
params=params)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
@query_params('filter_blocks', 'filter_index_templates', 'filter_indices',
|
@query_params('local', 'master_timeout', 'flat_settings')
|
||||||
'filter_metadata', 'filter_nodes', 'filter_routing_table', 'local',
|
def state(self, metric=None, index=None, params=None):
|
||||||
'master_timeout', 'flat_settings')
|
|
||||||
def state(self, params=None):
|
|
||||||
"""
|
"""
|
||||||
Get a comprehensive state information of the whole cluster.
|
Get a comprehensive state information of the whole cluster.
|
||||||
`<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-state.html>`_
|
`<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-state.html>`_
|
||||||
|
|
||||||
:arg filter_blocks: Do not return information about blocks
|
:arg metric: Limit the information returned to the specified metrics.
|
||||||
:arg filter_index_templates: Do not return information about index templates
|
Possible values: "_all", "blocks", "index_templates", "metadata",
|
||||||
:arg filter_indices: Limit returned metadata information to specific indices
|
"nodes", "routing_table"
|
||||||
:arg filter_metadata: Do not return information about indices metadata
|
:arg index: A comma-separated list of index names; use `_all` or empty
|
||||||
:arg filter_nodes: Do not return information about nodes
|
string to perform the operation on all indices
|
||||||
:arg filter_routing_table: Do not return information about shard allocation (`routing_table` and `routing_nodes`)
|
|
||||||
:arg local: Return local information, do not retrieve the state from master node (default: false)
|
:arg local: Return local information, do not retrieve the state from master node (default: false)
|
||||||
:arg master_timeout: Specify timeout for connection to master
|
:arg master_timeout: Specify timeout for connection to master
|
||||||
:arg flat_settings: Return settings in flat format (default: false)
|
:arg flat_settings: Return settings in flat format (default: false)
|
||||||
"""
|
"""
|
||||||
_, data = self.transport.perform_request('GET', '/_cluster/state', params=params)
|
if index and not metric:
|
||||||
|
metric = '_all'
|
||||||
|
_, data = self.transport.perform_request('GET', _make_path('_cluster/state', metric, index), params=params)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user