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 | 52
Part no.9036931-00 Rev AA February 2021
Name VID Protocol Addr Flags Proto Ports Virtual
Active router
/Total
-----------------------------------------------------------------------------------------------
interco 4094 10.1.1.2 /24 -f------------------------ ANY 1 /1 VR-Default
VLAN_0010 10 ---------------------------------------------- ANY 1 /1 VR-Default
VLAN_0011 11 ---------------------------------------------- ANY 1 /1 VR-Default
VLAN_0012 12 ---------------------------------------------- ANY 1 /1 VR-Default
VLAN_0013 13 ---------------------------------------------- ANY 1 /1 VR-Default
VLAN_0014 14 ---------------------------------------------- ANY 1 /1 VR-Default
VLAN_0015 15 ---------------------------------------------- ANY 1 /1 VR-Default
-----------------------------------------------------------------------------------------------
Flags : (B) BFD Enabled, (c) 802.1ad customer VLAN, (C) EAPS Control VLAN,
(d) Dynamically created VLAN, (D) VLAN Admin Disabled,
(E) ESRP Enabled, (f) IP Forwarding Enabled,
(F) Learning Disabled, (i) ISIS Enabled,
(I) Inter-Switch Connection VLAN for MLAG, (k) PTP Configured,
(l) MPLS Enabled, (L) Loopback Enabled, (m) IPmc Forwarding Enabled,
(M) Translation Member VLAN or Subscriber VLAN, (n) IP Multinetting Enabled,
(N) Network Login VLAN, (o) OSPF Enabled, (O) Virtual Network Overlay,
(p) PIM Enabled, (P) EAPS protected VLAN, (r) RIP Enabled,
(R) Sub-VLAN IP Range Configured, (s) Sub-VLAN, (S) Super-VLAN,
(t) Translation VLAN or Network VLAN, (T) Member of STP Domain,
(v) VRRP Enabled, (V) VPLS Enabled, (W) VPWS Enabled,
(Y) Policy Enabled
Total number of VLAN(s) : 9 (7 displayed)
However, the real focus is to work with JSON output, which is easier from a programming perspective.
Note: The JSON output is not documented, you must test your CALLs prior to writing your application.
The following example lists all the VLANs from two switches, and extracts and displays information
about these VLANs. For simplicity, hard code the information about the switches and the CLI command
you want to use.
from jsonrpc import JsonRPC
IPS = ["192.168.56.121", "192.168.56.122"]
USER = "admin"
PW = ""
def main():
vlans = []
for ip in IPS:
# you open a jsonrpc session to the switch
jsonrpc = JsonRPC(ip, USER, PW)
response = jsonrpc.cli("show vlan")










