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 | 43
Part no.9036931-00 Rev AA February 2021
You will also need to add the verify=False parameter to the request CALLs.
EXOS allows you to install customer certificates that have been signed by trusted authorities.
3.2.1.4 Using Restconf with Python
Use the restconf.py class available on Extreme Networks Github. At the time of writing of this document,
the version of the class is 1.2.0.0.
Note: The restconf.py class is compatible with Python 2.7 and 3.x. It tries HTTPS first, then fallback to HTTP
if unsuccessful.
This example creates a session to your switch and list all available VLANs. This example uses Argparse to
manage the parameters from the command line.
from restconf import Restconf
import json
import getpass
import argparse
# manage your arguments
def get_params():
parser = argparse.ArgumentParser(prog = 'RestDemo')
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 main():
args = get_params()
if args.username is None:
# prompt for username
args.username = input('Enter remote system username: ')
# also get password
args.password = getpass.getpass('Remote system password: ')
# open a restconf session
rest = Restconf(args.ip, args.username, args.password)










