Skip to content

Commit

Permalink
Merge pull request #23 from gbaufake/SWSQE-636
Browse files Browse the repository at this point in the history
Adding Post Method to Kiali Client
  • Loading branch information
mattmahoneyrh authored Mar 11, 2019
2 parents 337f7a9 + 1d54ab2 commit 815d6ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 9 additions & 2 deletions kiali/api_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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):
Expand Down
4 changes: 1 addition & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[metadata]
name = kiali-client
author = Guilherme Baufaker Rego
version = 0.8.0
author_email = "[email protected]
summary = Python client to communicate with Kiali server over HTTP(S)
description-file =
Expand All @@ -19,6 +20,3 @@ classifiers =
[files]
packages =
kiali
[bdist_wheel]
universal = 1

0 comments on commit 815d6ca

Please sign in to comment.