Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/thoughtspot_rest_api_v1/tsrestapiv1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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'
Expand Down