Extreme API with Python
Table Of Contents
- 1 Preface
- 2 Introduction
- 3 EXOS APIs
- 4 VOSS API
- 5 XMC API
- 6 ExtremeCloud IQ API
- 7 Extreme Campus Controller API
Extreme API with Python
Page | 141
Part no.9036931-00 Rev AA February 2021
7.4 Use PUT
In this example, rename your newly created role. You must do a PUT on the role, using its ID in the
endpoint, and sending the updated JSON data structure.
Make a slight modification to your code:
data = restGet('/management/v3/roles')
if data:
print("\nThere are {} roles".format(len(data)))
found = False
for name in data:
if name.get('name') == "Stef":
print("The role Stef already exists")
found = True
role = name
break
if not found:
role = {'name': 'Stef', 'defaultAction': 'allow', 'defaultCos': None}
r = requests.post(baseURL + '/management/v3/roles', verify=False,
headers=myHeaders, json=role)










