diff --git a/src/thoughtspot_rest_api_v1/tsrestapiv1.py b/src/thoughtspot_rest_api_v1/tsrestapiv1.py index 09ccf3e..3e5a425 100644 --- a/src/thoughtspot_rest_api_v1/tsrestapiv1.py +++ b/src/thoughtspot_rest_api_v1/tsrestapiv1.py @@ -11,9 +11,10 @@ # We have chosen to make it as simple to understand as possible. There are comments # and notes written throughout to help the reader understand more. # +import json from collections import OrderedDict from typing import Optional, Dict, List, Union -import json +from copy import copy import requests @@ -1286,6 +1287,18 @@ def security_effectivepermissionbulk(self, ids_by_type: Dict, dependent_share: b # SESSION Methods # + def session_isactive(self): + """ + Check if the login session is active + Returns: + bool: True/False + """ + url = f"{self.non_public_base_url}session/isactive" + headers = copy(self.requests_session.headers) + headers.update({"Accept": "*/*"}) + response = self.requests_session.get(url, headers=headers) + return response.ok + # Home Pinboard Methods def session_homepinboard_post(self, pinboard_guid: str, user_guid: str): endpoint = 'session/homepinboard'