New node_info API

This commit is contained in:
Honza Král
2014-01-08 20:23:24 +01:00
parent 80dcf406b7
commit bc976f1bb6
+10 -16
View File
@@ -112,9 +112,8 @@ class ClusterClient(NamespacedClient):
_make_path('_nodes', node_id, 'stats', metric, fields), params=params) _make_path('_nodes', node_id, 'stats', metric, fields), params=params)
return data return data
@query_params('all', 'clear', 'http', 'jvm', 'network', 'os', 'plugin', @query_params('flat_settings')
'process', 'settings', 'thread_pool', 'timeout', 'transport') def node_info(self, node_id=None, metric=None, params=None):
def node_info(self, node_id=None, params=None):
""" """
Retrieve one or more (or all) of the cluster nodes' information. Retrieve one or more (or all) of the cluster nodes' information.
`<http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-info/>`_ `<http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-info/>`_
@@ -122,21 +121,16 @@ class ClusterClient(NamespacedClient):
:arg node_id: A comma-separated list of node IDs or names to limit the :arg node_id: A comma-separated list of node IDs or names to limit the
returned information; use `_local` to return information from the node returned information; use `_local` to return information from the node
you're connecting to, leave empty to get information from all nodes you're connecting to, leave empty to get information from all nodes
:arg all: Return all available information :arg metric: A comma-separated list of metrics you wish returned. Leave
:arg clear: Reset the default settings empty to return all. Possible options are "settings", "os",
:arg http: Return information about HTTP "process", "jvm", "thread_pool", "network", "transport", "http" and
:arg jvm: Return information about the JVM "plugin"
:arg network: Return information about network :arg flat_settings: Return settings in flat format (default: false)
:arg os: Return information about the operating system
:arg plugin: Return information about plugins
:arg process: Return information about the Elasticsearch process
:arg settings: Return information about node settings
:arg thread_pool: Return information about the thread pool
:arg timeout: Explicit operation timeout
:arg transport: Return information about transport
""" """
if not node_id and metric:
node_id = '_all'
_, data = self.transport.perform_request('GET', _, data = self.transport.perform_request('GET',
_make_path('_cluster', 'nodes', node_id), params=params) _make_path('_nodes', node_id, metric), params=params)
return data return data
@query_params('delay', 'exit') @query_params('delay', 'exit')