From 78f5f0f4bb5fe2a704796a86ee8af71f18744a4e Mon Sep 17 00:00:00 2001 From: Honza Kral Date: Wed, 24 Jul 2013 17:47:39 +0200 Subject: [PATCH] Node shutdown API --- elasticsearch/client/cluster.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/elasticsearch/client/cluster.py b/elasticsearch/client/cluster.py index 1cd7e134..3372aa03 100644 --- a/elasticsearch/client/cluster.py +++ b/elasticsearch/client/cluster.py @@ -120,3 +120,16 @@ class ClusterClient(NamespacedClient): status, data = self.transport.perform_request('GET', _make_path('_cluster', 'nodes', node_id), params=params) return data + @query_params('delay', 'exit') + def node_shutdown(self, node_id=None, params=None): + """ + The nodes shutdown API allows to shutdown one or more (or all) nodes in the cluster. + http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-shutdown/ + + :arg node_id: A comma-separated list of node IDs or names to perform the operation on; use `_local` to perform the operation on the node you're connected to, leave empty to perform the operation on all nodes + :arg delay: Set the delay for the operation (default: 1s) + :arg exit: Exit the JVM as well (default: true) + """ + status, data = self.transport.perform_request('POST', _make_path('_cluster', 'nodes', node_id, '_shutdown'), params=params) + return data +