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 | 125
Part no.9036931-00 Rev AA February 2021
except requests.exceptions.RequestException as e:
print("There was an error accessing XIQ API")
sys.exit(1)
data = r.json()
up = 0
down = 0
for port in data.get('data').get('ports'):
if port.get('status') == "UP":
up += 1
elif port.get('status') == "DOWN":
down += 1
print("\t{} ports UP and {} ports DOWN".format(up, down))
if len(VSPList):
print("\nVSP switches:")
for vsp in VSPList:
print('\t{} with IP {} running VOSS version {}'.format(vsp['model'],
vsp['ip'],
vsp['firmware']))
It is important to note the following:
- The URL to XIQ depends on your RDC. This is the URL in your browser when you are connected
to your account. In this example, this is HTTPS://ie.extremecloudiq.com
.
- The endpoint that you use, in this case v1/monitor/devices, must be prepended by
xapi/.
When you run the Python script, you should see the following:
C:\Extreme API with Python> xiq.py
Found 1 EXOS switches and 0 VSP switches
EXOS switches:
X460_G2_24p_10_G4 with IP 192.168.254.160 running EXOS version
30.6.1.11 patch1-11
2 ports UP and 33 ports DOWN
6.2.2 Use POST
To send data to XIQ, you must use either a POST or a PUT, depending on the endpoint. The
documentation describes which one to use.
The framework is similar to that of the GET method, but now you need to build the JSON data to send to
XIQ.










