From 62036e5b9f9d0ce8351d27873841cd50533f98cb Mon Sep 17 00:00:00 2001 From: Honza Kral Date: Thu, 18 Jul 2013 16:36:38 +0200 Subject: [PATCH] cluster.reroute API --- elasticsearch/client/cluster.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/elasticsearch/client/cluster.py b/elasticsearch/client/cluster.py index dc00772c..733b4d5b 100644 --- a/elasticsearch/client/cluster.py +++ b/elasticsearch/client/cluster.py @@ -19,3 +19,17 @@ class ClusterClient(NamespacedClient): """ status, data = self.transport.perform_request('GET', _make_path('_cluster', 'health', index), params=params) return data + + @query_params('dry_run', 'filter_metadata') + def reroute(self, body=None, params=None): + """ + The reroute command allows to explicitly execute a cluster reroute allocation command including specific commands. + http://elasticsearch.org/guide/reference/api/admin-cluster-reroute/ + + :arg body: The definition of `commands` to perform (`move`, `cancel`, `allocate`) + :arg dry_run: Simulate the operation only and return the resulting state + :arg filter_metadata: Don't return cluster state metadata (default: false) + """ + status, data = self.transport.perform_request('POST', _make_path('_cluster', 'reroute'), params=params, body=body) + return data +