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 | 60
Part no.9036931-00 Rev AA February 2021
ship the latest revision of the modules. These are available on the Extreme Networks Github, and it is
advisable to update them to the latest version available.
Note: At the time of writing of this document, latest versions are v2.0.0.4 for jsonrpc.py, v1.2.0.0
for restconf.py and v1.0.0.1 for restconf_voss.py.
5.1.4 System Path and Precedence
The following paths are automatically added to the system path:
appdata/scripting/overrides
appdata/scripting/extensions
appdata/scripting/system
appdata/scripting/
NetSight/jython/Lib
NetSight/jython/Lib/site-packages
NetSight/jython
If identical Python modules are found, the expected precedence is that overrides is used first.
5.1.5 Install a Library
To install a library, the easiest way is to use PIP. Starting with XMC 8.1.2, the PIP utility is part of the
default XMC server installation. The commands to use the PIP utility to install a library are:
cd /usr/local/Extreme_Networks/NetSight/jython/bin
export JAVA_HOME=/usr/local/Extreme_Networks/NetSight/java
sudo chmod a+x pip
sudo chmod a+x jython
./pip install <module>
5.1.6 XMC Python Module
5.1.6.1 emc_vars
When you are writing Python scripts to be run directly from XMC, you can use a global variable named
emc_vars. This variable is a Python dictionary containing all global variables in the system.
It is important to understand this key element. When a Python script must be executed on a device, this
global variable can provide a great deal of useful information about that device, such as IP address,
vendor profile, product family, etc.
With information easily accessible, you can create powerful scripts to run on different products. Another
benefit of XMC is that you do not need to manage device access or store login credentials.
The XMC 8.4.4 list of variables in the emc_vars dictionary is shown below, as returned from this script
executed in XMC:










