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 | 56
Part no.9036931-00 Rev AA February 2021
The way to use RESTCONF is identical to that of EXOS, and the endpoints follow the same logic. Be
careful to use the default port used in VOSS for RESTCONF, which is 8080 for HTTP. It must be provided
along with the IP address.
The RESTCONF Python class is available on the Extreme Networks github:
HTTPS://github.com/extremenetworks/ExtremeScripting/blob/master/VOSS/restconf.py
Note: Starting with XMC 8.5, the restconf_voss.py Python class is shipped by default with XMC.
The following example retrieves all existing VLANs on a VOSS switch (or a VM), then adds one and then
deletes it. To better illustrate how similar this process is to EXOS and VOSS, the same code base is
reused, except the data required to create a VLAN on VOSS is modified to add a new parameter.
from restconf_voss import Restconf
import getpass
import argparse
DEFAULT_TCP_PORT = '8080'
# manage your arguments
def get_params():
parser = argparse.ArgumentParser(prog = 'VossRestDemo')
parser.add_argument('-i', '--ip',
help='IP Address of the switch',
required=True)
parser.add_argument('-u', '--username',
help='Login username for the remote system')
parser.add_argument('-p', '--password',
help='Login password for the remote system',
default='')
args = parser.parse_args()
return args
def list_vlans(rest):
# you make a GET API call for all the vlans
info = rest.get('data/openconfig-vlan:vlans')
data = info.json()
vlans = data.get('openconfig-vlan:vlans').get('vlan')
for vlan in vlans:










