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 | 47
Part no.9036931-00 Rev AA February 2021
The result:
C:\Extreme API with Python> rest_example.py -i 192.168.56.121 -u admin
Found VLAN Default with VID 1
Found VLAN VLAN_0054 with VID 54
Found VLAN interco with VID 4094
------------------------------------------
Found VLAN Default with VID 1
Found VLAN H2G2 with VID 42
Found VLAN VLAN_0054 with VID 54
Found VLAN interco with VID 4094
------------------------------------------
Found VLAN Default with VID 1
Found VLAN VLAN_0054 with VID 54
Found VLAN interco with VID 4094
On the switch, you can see the actions have happened, assuming your Python application (from chapter
3.1.2) is still running.
sw1.10 # sh log
06/09/2020 23:17:01.39 <Info:AAA.logout> Administrative account (admin)
logout from app (192.168.56.1)
06/09/2020 23:16:49.58 <Info:System.userComment> Ohoh! VLAN H2G2 has been
deleted
06/09/2020 23:16:41.39 <Info:AAA.authPass> Login passed for user admin
through app (192.168.56.1)
06/09/2020 23:16:30.52 <Noti:log.ClrLogMsg> User admin: Cleared the log
messages in memory-buffer.
A total of 4 log messages are displayed.
To change the configuration of an existing VLAN, use the PATCH HTTP method directly on the endpoint’s
config container to send the modified parameter.
Add the following piece of code to your example:
# you add the vlan again
r = rest.post(url, data)
# you list the existing vlans after to check again
print("-"*42)
list_vlans(rest)
# you change the name
patch_url = url + "vlan=42" + "/config/"
info = {}
info["openconfig-vlan:config"] = {"name": "Zaphod"}
rest.patch(patch_url, info)










