diff --git a/unit_tests/cloudsdk.py b/unit_tests/cloudsdk.py index b790d113f..645124b9f 100755 --- a/unit_tests/cloudsdk.py +++ b/unit_tests/cloudsdk.py @@ -127,6 +127,16 @@ class CloudSDK: response = requests.request("GET", fw_id_url, headers=headers, data=payload) return response.json() + def get_customer(self, cloudSDK_url, bearer, customer_id): + fw_id_url = cloudSDK_url + "/portal/customer" + "?customerId=" + customer_id + + payload = {} + headers = { + 'Authorization': 'Bearer ' + bearer + } + response = requests.request("GET", fw_id_url, headers=headers, data=payload) + return response.json() + def delete_firmware(self, fw_id, cloudSDK_url, bearer): url = cloudSDK_url + '/portal/firmware/version?firmwareVersionId=' + fw_id payload = {} diff --git a/unit_tests/query_sdk.py b/unit_tests/query_sdk.py index 26c44465f..e43ffb657 100755 --- a/unit_tests/query_sdk.py +++ b/unit_tests/query_sdk.py @@ -4,7 +4,7 @@ from UnitTestBase import * base = UnitTestBase("query-sdk") -# 5G SSIDs +# Get customer profiles try: ssids = base.cloud.get_customer_profiles(base.cloudSDK_url, base.bearer, base.customer_id) print("Profiles for customer %s:"%(base.customer_id)) @@ -14,3 +14,16 @@ except Exception as ex: print(ex) logging.error(logging.traceback.format_exc()) print("Failed to read customer profiles") + +# Get customer info. I don't see any way to query for all customer IDs, so just look at first 3 for now. +for customer_id in range(4): + try: + # NOTE: Could also use base.customer_id to get single one that user may have specified. + ssids = base.cloud.get_customer(base.cloudSDK_url, base.bearer, "%i"%(customer_id)) + print("Customer %i:"%(customer_id)) + #jobj = json.load(ssids) + print(json.dumps(ssids, indent=4, sort_keys=True)) + except Exception as ex: + print(ex) + logging.error(logging.traceback.format_exc()) + print("Failed to read Customer %i"%(customer_id))