From 6c5ff986fe4633e21f6d11ecdc969e710f85d853 Mon Sep 17 00:00:00 2001 From: Francesco Vigliaturo Date: Thu, 9 Jan 2020 16:43:28 +0100 Subject: [PATCH] adds python client support for 7.5 --- Changelog.rst | 4 ++++ elasticsearch/__init__.py | 2 +- elasticsearch/client/slm.py | 24 +++++++++++++++++++++++ setup.py | 2 +- test_elasticsearch/start_elasticsearch.sh | 2 +- 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/Changelog.rst b/Changelog.rst index efe822a1..15068ec1 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -3,6 +3,10 @@ Changelog ========= +7.5.0 (2020-01-09) +------------------ + * Update client to support ES 7.5 APIs + 7.1.0 (2019-11-14) ------------------ * Fix sniffing with ``http.publish_host`` diff --git a/elasticsearch/__init__.py b/elasticsearch/__init__.py index 34b590d6..0e719ef2 100644 --- a/elasticsearch/__init__.py +++ b/elasticsearch/__init__.py @@ -1,7 +1,7 @@ # flake8: noqa from __future__ import absolute_import -VERSION = (7, 1, 0) +VERSION = (7, 5, 0) __version__ = VERSION __versionstr__ = ".".join(map(str, VERSION)) diff --git a/elasticsearch/client/slm.py b/elasticsearch/client/slm.py index d09c2623..7e37a7e3 100644 --- a/elasticsearch/client/slm.py +++ b/elasticsearch/client/slm.py @@ -76,3 +76,27 @@ class SlmClient(NamespacedClient): return self.transport.perform_request( "PUT", _make_path("_slm", "policy", policy_id), params=params, body=body ) + + @query_params() + def get_status(self, params=None): + """ + ``_ + + """ + return self.transport.perform_request("GET", "/_slm/status", params=params) + + @query_params() + def start(self, params=None): + """ + ``_ + + """ + return self.transport.perform_request("POST", "/_slm/start", params=params) + + @query_params() + def stop(self, params=None): + """ + ``_ + + """ + return self.transport.perform_request("POST", "/_slm/stop", params=params) diff --git a/setup.py b/setup.py index 4bcaf589..c15b47b5 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from os.path import join, dirname from setuptools import setup, find_packages import sys -VERSION = (7, 1, 0) +VERSION = (7, 5, 0) __version__ = VERSION __versionstr__ = ".".join(map(str, VERSION)) diff --git a/test_elasticsearch/start_elasticsearch.sh b/test_elasticsearch/start_elasticsearch.sh index 4018f466..ae3a0cb5 100755 --- a/test_elasticsearch/start_elasticsearch.sh +++ b/test_elasticsearch/start_elasticsearch.sh @@ -2,7 +2,7 @@ # Start elasticsearch in a docker container -ES_VERSION=${ES_VERSION:-"7.0.0"} +ES_VERSION=${ES_VERSION:-"7.5.0"} ES_TEST_SERVER=${ES_TEST_SERVER:-"http://localhost:9200"} SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"