From 81909a129480f8bdb90d75fd79d5747887d5541e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Baufaker=20R=C3=AAgo?= Date: Mon, 11 Mar 2019 15:08:52 +0100 Subject: [PATCH 1/2] Adding Post Method to Kiali-Client --- kiali/api_connector.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/kiali/api_connector.py b/kiali/api_connector.py index c440aae..aef5788 100644 --- a/kiali/api_connector.py +++ b/kiali/api_connector.py @@ -32,6 +32,9 @@ def dispatcher(self, url, params=None, http_method='GET', data=None): if http_method is 'GET': return self.get(url=url, params=params) + if http_method is 'POST': + return self.post(url=url, params=params, data=data) + if http_method is 'PATCH': return self.patch(url=url, params=params, data=data) @@ -43,13 +46,17 @@ def get(self, url, params=None): session = self.create_session() return session.get(url=self.retrieve_url(url), verify=self.verify, params=params) + def post(self, url, params=None): + session = self.create_session() + return session.post(url=self.retrieve_url(url), verify=self.verify, data=data, params=params) + def patch(self, url, data, params=None): session = self.create_session() - return session.patch(url=self.retrieve_url(url), data=data, params=params) + return session.patch(url=self.retrieve_url(url), verify=self.verify, data=data, params=params) def delete(self, url, data, params=None): session = self.create_session() - return session.delete(url=self.retrieve_url(url), data=data, params=params) + return session.delete(url=self.retrieve_url(url), verify=self.verify, data=data, params=params) class KialiHTTPSApiConnector(KialiApiConnector): From 1d54ab27b9793e30157637f4c4479775ac7c50ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Baufaker=20R=C3=AAgo?= Date: Mon, 11 Mar 2019 15:53:53 +0100 Subject: [PATCH 2/2] Adding Version Tag --- setup.cfg | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 9bbca61..634402e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,7 @@ [metadata] name = kiali-client author = Guilherme Baufaker Rego +version = 0.8.0 author_email = "gbaufake@redhat.com summary = Python client to communicate with Kiali server over HTTP(S) description-file = @@ -19,6 +20,3 @@ classifiers = [files] packages = kiali - -[bdist_wheel] -universal = 1