def getAllSessionId(self): """ Show all opened session IDs. Return A list of opened session IDs. {4: {'startedOn': '2018-10-06 12:09:18.333-07:00', 'state': 'Active', 'subState': 'Ready', 'userName': 'admin'}, 5: {'startedOn': '2018-10-06 18:49:05.691-07:00', 'state': 'Active', 'subState': 'Ready', 'userName': 'admin'} } """ response = self.get(self.httpHeader+'/api/v1/sessions', silentMode=True) sessionId = {} for eachSessionId in response.json(): sessionId.update({eachSessionId['id']: {'userName': eachSessionId['userName'], 'createdOn': eachSessionId['createdOn'].replace('T', ' '), 'state': eachSessionId['state'], 'subState': eachSessionId['subState'] } }) print('\nSessionId: {}'.format(eachSessionId['id'])) print(' UserName: {}'.format(eachSessionId['userName'])) print(' StartedOn: {}'.format(eachSessionId['createdOn'].replace('T', ' '))) print(' State: {}'.format(eachSessionId['state'])) print(' SubState: {}'.format(eachSessionId['subState'])) print() return sessionId