Extreme API with Python

Table Of Contents
Extreme API with Python
Page | 113
Part no.9036931-00 Rev AA February 2021
Name Type Description
source string Extreme Analytics appliance IP address
Returns: flow data in JSON format.
5.4.1.8 getVersion
Retrieve Extreme Analytics version.
Returns: Version as a string.
5.4.1.9 importLocationCSV
This creates locations with a provided CSV string.
Parameters:
Name
Type
Description
locationGroup
string
Location group name
csv string CSV data, data must be in a format where line 1 contains
“name,ipmask” without quotes. Subsequent lines will contain the
“<location name>,<IP subnet/mask>” without quotes.
overwrite boolean True to replace locations with the same name
purge boolean True to remove any locations not imported
protect boolean True to block operation if any locations would be overwritten
Returns: A string status.
5.4.2 Analytics API with Python
This section contains examples using the Axis API with Analytics web services. The examples retrieve
data from the Applications tab as a bidirectional flow, and check the appliance version.
Although you must format the payload data as JSON, the API returns query results in XML format.
import xml.etree.ElementTree as ET
import json
import os
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
login = os.environ.get('xmclogin')
passw = os.environ.get('xmcpassw')
url = 'HTTPS://192.168.20.80:8443/axis/services/PurviewWebService/'