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 | 135
Part no.9036931-00 Rev AA February 2021
"scopes" : {
"site" : "RW",
"network" : "RW",
"deviceAp" : "RW",
"deviceSwitch" : "RW",
"eGuest" : "RW",
"adoption" : "RW",
"troubleshoot" : "RW",
"onboardAaa" : "RW",
"onboardCp" : "RW",
"onboardGroupsAndRules" : "RW",
"onboardGuestCp" : "RW",
"platform" : "RW",
"account" : "RW",
"application" : "RW",
"license" : "RW",
"cliSupport" : "RW"
}
In return, the Extreme Campus Controller server issues a token. This is the Bearer token that you will use
for REST API CALLs. The token has a finite lifetime that defaults to 7200 seconds (which is 2 hours).
Depending on the configured user privileges, the adminRole is either FULL, allowing access in read-write
(RW) to everything, or read (R), granting read-only access.
This information is part of the response from the Extreme Campus Controller server. For example:
import os
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
xcclogin = os.environ.get('xcclogin')
xccpassw = os.environ.get('xccpassw')
auth_url = 'HTTPS://192.168.20.90:5825/management/v1/oauth2/token'
auth_body = {'grantType': 'password', 'userId': xcclogin, 'password': xccpassw}
r = requests.post(auth_url, verify=False, json=auth_body)
print(r.text)
The response:










