Extreme API with Python

Table Of Contents
Extreme API with Python
Page | 143
Part no.9036931-00 Rev AA February 2021
7.5 Use DELETE
This example shows you how to delete the role you just created using DELETE. Add the instruction at
the end of your code, as shown below:
data = restGet('/management/v3/roles')
if data:
for name in data:
if name.get('name') in ["Stef", "H2G2"]:
print("Deleting role {}".format(name.get('name')))
r = requests.delete(baseURL + '/management/v3/roles/{}'.format(name['id']),
verify=False, headers=myHeaders)
print(r.content)
Run the script to see the following:
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},