Add Create AP Profile test cases to Nightly Sanity

This commit is contained in:
bealler
2020-12-10 13:10:18 -05:00
parent d4b5f3e71d
commit d7f1c922ae
4 changed files with 274 additions and 49 deletions

View File

@@ -179,3 +179,23 @@ class CloudSDK:
cloud_sdk_version = response.json()
return cloud_sdk_version
def create_ap_profile(cloudSDK_url, bearer, template, name, child_profiles):
with open(template, 'r+') as ap_profile:
profile = json.load(ap_profile)
profile["name"] = name
profile["childProfileIds"] = child_profiles
print(profile["childProfileIds"])
with open(template, 'w') as ap_profile:
json.dump(profile, ap_profile)
url = cloudSDK_url+"/portal/profile"
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + bearer
}
response = requests.request("POST", url, headers=headers, data=open(template, 'rb'))
ap_profile = response.json()
print(ap_profile)
ap_profile_id = ap_profile['id']
return ap_profile_id