def connectToLinuxIxosChassis(self, chassisIp, username, password): url = 'https://{0}/platform/api/v1/auth/session'.format(chassisIp) response = self.post(url, data={'username': username, 'password': password}) self.apiKey = response.json()['apiKey'] self.jsonHeader = {'content-type': 'application/json', 'x-api-key': self.apiKey} # userAccountUrl: https://{ip}/platform/api/v1/auth/users/{id} self.userSessionId = response.json()['userAccountUrl'] self.ixosHeader = 'https://{0}/chassis/api/v2/ixos'.format(chassisIp) self.chassisPlatformHeader = 'https://{0}/platform/api/v2'.format(chassisIp) self.diagnosticsHeader = 'https://{0}/chassis/api/v1/diagnostics'.format(chassisIp) self.authenticationHeader = 'https://{0}/chassis/api/v1/auth'.format(chassisIp) self.sessionUrl = self.ixosHeader