From daa4885836408ed39aac85a157e978b2bfa661a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Wed, 2 Jul 2014 17:10:49 +0200 Subject: [PATCH] Adding back snapshot_index removed in ef30042 for backwards compatibility --- elasticsearch/client/indices.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/elasticsearch/client/indices.py b/elasticsearch/client/indices.py index 6b8608ca..08d416fe 100644 --- a/elasticsearch/client/indices.py +++ b/elasticsearch/client/indices.py @@ -822,3 +822,25 @@ class IndicesClient(NamespacedClient): _, data = self.transport.perform_request('GET', _make_path(index, '_recovery'), params=params) return data + + @query_params('allow_no_indices', 'expand_wildcards', 'ignore_indices', 'ignore_unavailable') + def snapshot_index(self, index=None, params=None): + """ + Explicitly perform a snapshot through the gateway of one or more indices (backup them). + ``_ + + :arg index: A comma-separated list of index names; use `_all` or empty + string for all indices + :arg allow_no_indices: Whether to ignore if a wildcard indices + expression resolves into no concrete indices. (This includes `_all` string or + when no indices have been specified) + :arg expand_wildcards: Whether to expand wildcard expression to concrete indices + that are open, closed or both. + :arg ignore_indices: When performed on multiple indices, allows to + ignore `missing` ones (default: none) + :arg ignore_unavailable: Whether specified concrete indices should be ignored + when unavailable (missing or closed) + """ + _, data = self.transport.perform_request('POST', + _make_path(index, '_gateway', 'snapshot'), params=params) + return data