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 | 29
Part no.9036931-00 Rev AA February 2021
3 EXOS APIs
EXOS offers several APIs for developers that support on-switch automation and external automation.
The following sections describe these options.
3.1 On-Switch APIs
EXOS has included automation and scripting since its original inception. The first scripting
interface offered to the users, and still present today, is called CLI Scripting and uses TCL functions
for advanced scripting. You’ll not cover this scripting interface in this guide, but rather focus on
the more modern Python capabilities.
3.1.1 Python Scripting
Starting with the release of EXOS 15.6, Python has been added to the EXOS scripting toolbox. The
Python version used is 2.7, and more precisely it was 2.7.3 before being upgraded with EXOS 30.1 to
version 2.7.15.
The standard library is available, along with extra modules such as Argparse and Requests.
To see the full list of available modules, create a simple one-line script and execute it on a switch:
help('modules')
3.1.1.1 Create a Python Script
There are several options for creating a script on an EXOS switch. Either you create it directly on it, from
the CLI, or you do it on your computer and send it to switch when completed.
From the CLI, you can access a light version of vi using either the command “vi” or “edit”. When you
create a new file with this command, it must have a supported file extension by EXOS. The supported
file extensions are .pol, .pkt, .xsf, .py and .xml. Obviously, when writing a Python script, you must use the
official .py file extension.
Note: when you create a file, it is located by default into /config, which is an alias for
/usr/local/cfg.
Some text editors and IDE can edit a remote file using SSH, SCP or similar transfer protocols. This
capability can be built-in or added using a plug-in. It may be easier to manipulate files this way.
3.1.1.2 Copying Python Scripts to a Switch
If you are not working directly from the switch CLI, you can copy the files to the switch using TFTP or
SCP. For example, assuming you have a TFTP server running on your PC (such as
tftpd64) and pointing
to the correct directory, you can copy the files from the CLI this way:
sw1.2 # tftp get 192.168.56.1 vr VR-Mgmt MyScript.py










