Extreme API with Python

Table Of Contents
Extreme API with Python
Page | 140
Part no.9036931-00 Rev AA February 2021
break
if not found:
role = {'name': 'Stef', 'defaultAction': 'allow', 'defaultCos': None}
r = requests.post(baseURL + '/management/v3/roles', verify=False,
headers=myHeaders, json=role)
if r.status_code != 201:
print("Cannot access XCC REST API! Error code: {}".format(r.status_code))
print(r.content)
exit(0)
The output should look like this:
C:\Extreme API with Python> xcc.py
There are 35 APs
[{'model': 'AP310', 'count': 1}, {'model': 'AP3917', 'count': 1}, {'model':
'AP460', 'count': 1}, {'model': 'AP3912', 'count': 3}, {'model': 'AP3935',
'count': 3}, {'model': 'AP410', 'count': 3}, {'model': 'AP510', 'count': 3},
{'model': 'AP3915', 'count': 4}, {'model': 'AP3916', 'count': 4}, {'model':
'AP505', 'count': 4}, {'model': 'SA201', 'count': 8}]
There are 42 roles
Log in to your Extreme Campus Controller server to confirm that you have one more role (43) and the
role you created is listed.