Extreme API with Python

Table Of Contents
Extreme API with Python
Page | 142
Part no.9036931-00 Rev AA February 2021
if r.status_code != 201:
print("Cannot access XCC REST API! Error code: {}".format(r.status_code))
print(r.content)
exit(0)
else:
role['name'] = "H2G2"
r = requests.put(baseURL + '/management/v3/roles/{}'.format(role['id']),
verify=False, headers=myHeaders, json=role)
if r.status_code != 200:
print("Cannot access XCC REST API! Error code: {}".format(r.status_code))
print(r.content)
else:
print("Role name changed")
The result:
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 43 roles
The role Stef already exists
Role name changed
In Extreme Campus Controller, you can confirm that the role name has been changed.