Skip to content

Commit

Permalink
Add health function
Browse files Browse the repository at this point in the history
  • Loading branch information
jojoob committed Nov 21, 2018
1 parent 8f35c9c commit 7e0f15c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions thehive4py/api.py
Expand Up @@ -87,6 +87,13 @@ def do_patch(self, api_url, **attributes):
return requests.patch(self.url + api_url, headers={'Content-Type': 'application/json'}, json=attributes,
proxies=self.proxies, auth=self.auth, verify=self.cert)

def health(self):
req = self.url + "/api/health"
try:
return requests.get(req, proxies=self.proxies, auth=self.auth, verify=self.cert)
except requests.exceptions.RequestException as e:
raise TheHiveException("Error on retrieving health status: {}".format(e))

def create_case(self, case):

"""
Expand Down

0 comments on commit 7e0f15c

Please sign in to comment.