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 | 20
Part no.9036931-00 Rev AA February 2021
print(type(data))
print(len(data))
The result is shown below:
200
48959
<class 'bytes'>
48959
This example shows the success HTTP status code (200), and the amount of data returned in bytes.
2.6.2 Requests
Although Urllib provides all the required tools to manipulate URLs and HTTP CALLs, a better package
called Requests is commonly used.
HTTPS://requests.readthedocs.io/en/master/
The best practice is to install Requests with PIP.
Note: The Requests module is part of XMC Python scripting engine and EXOS Python scripting capability.
The following example creates a virtual environment in Windows 10 to demonstrate how to create and
activate a venv.
C:\> python -m venv "c:\Extreme API with Python"
C:\> cd "\Extreme API with Python"
C:\Extreme API with Python> dir
Directory of C:\Extreme API with Python
05-Jun-20 09:19 <DIR> .
05-Jun-20 09:19 <DIR> ..
03-Jun-20 16:00 <DIR> Extreme API with Python
05-Jun-20 01:47 492,137 Extreme API.docx
03-Jun-20 11:55 <DIR> Include
04-Jun-20 00:59 453 json-example.py
03-Jun-20 11:55 <DIR> Lib
02-Jun-20 19:43 5,537,071 Presentation1.pptx
03-Jun-20 11:55 125 pyvenv.cfg
04-Jun-20 13:47 167 requests-example.py
03-Jun-20 12:03 <DIR> Scripts
03-Jun-20 01:11 177 urllib-example.py
6 File(s) 6,030,130 bytes
6 Dir(s) 691,064,119,296 bytes free
C:\Extreme API with Python>
C:\Extreme API with Python> Scripts\activate.bat
(Extreme API with Python) C:\Extreme API with Python> pip install requests
Collecting requests










