mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 04:11:25 -07:00
Add checkpoint_session module (#50930)
* Add checkpoint_session module * Add unit test * Fix pep8 * Rename Checkpoint for Check Point
This commit is contained in:
parent
2135ddf233
commit
ac61c99821
5 changed files with 188 additions and 3 deletions
|
@ -40,6 +40,7 @@ class HttpApi(HttpApiBase):
|
|||
|
||||
try:
|
||||
self.connection._auth = {'X-chkp-sid': response_data['sid']}
|
||||
self.connection._session_uid = response_data['uid']
|
||||
except KeyError:
|
||||
raise ConnectionError(
|
||||
'Server returned response without token info during connection authentication: %s' % response)
|
||||
|
@ -49,8 +50,8 @@ class HttpApi(HttpApiBase):
|
|||
|
||||
response, dummy = self.send_request(url, None)
|
||||
|
||||
def get_sid(self):
|
||||
return self.connection._auth['X-chkp-sid']
|
||||
def get_session_uid(self):
|
||||
return self.connection._session_uid
|
||||
|
||||
def send_request(self, path, body_params):
|
||||
data = json.dumps(body_params) if body_params else '{}'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue