Skip to content

Commit

Permalink
Add server_reboot route + version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
fenrisl authored and hezanathos committed Jul 23, 2021
1 parent ea72658 commit 61d972f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions cbw_api_toolbox/cbw_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,3 +794,12 @@ def operating_systems(self):
logging.error("Error::{}".format(response.text))
return None
return self._cbw_parser(response)

def server_reboot(self, server_id, params=None):
"""POST request to /api/v3/vulnerabilities/servers/<id>/reboot to reboot a server"""
response = self._request("PATCH", [ROUTE_SERVERS, server_id, "reboot"], params)
if response.status_code != 200:
logging.error("Error::{}".format(response.text))
return None

return self._cbw_parser(response)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
description='CyberWatch Api Tools.',
long_description=open('README.md').read().strip(),
long_description_content_type="text/markdown",
version='2.2.2',
version='2.2.3',
author='CyberWatch SAS',
author_email='[email protected]',
license='MIT',
Expand Down

0 comments on commit 61d972f

Please sign in to comment.