ArubaAPI
Logs into the web UI of an Aruba Controller and issues arbitrary CLI show commands. This was created to alleviate the pain of screen-scraping ArubaOS output, especially tables.
The HTTP API used is the one that the web GUI uses to gather data. It's not terribly consistent and probably isn't guaranteed between AOS versions. Submit an issue or pull request if you see issues with the data you're receiving.
There are three types of data output from the HTTP API:
- Table data - Key is name of the table. Value is list of {key: value} dicts.
- Named data - Generally a key-value pair but not always. In the case of duplicate names, the value is a list of all values seen.
- Anonymous data - Auxiallary data output. Generally unstructured lines like flag legends. Stored under the 'data' key as a list.
Config commands appear to be able to be sent through this same interface one at a time. You will receive no data back from performing a config command, but it's important to note that an invalid command will also receive no data back. It's probably a good idea to double-check that the config change stayed with a subsequent show command.
Notes
- It really doesn't like
show running-config. It will just hang and return no data. - Sessions will not be deleted unless
close()is called or thewithstatement is used. - Invalid commands return an HTTP 200 with no data, so there's currently no way to detect them.
- Use
show user-tableinstead ofshow userto avoid parser issues due to a non-xml string being in the response of the latter.
Example
import arubaapi
from pprint import pprint
connection = arubaapi.ArubaAPI('aruba-master.example.com', 'username', 'password')
data = connection.cli('show ap database local')
connection.close()
pprint(data, 120)
Output:
{'data': ['Flags: U = Unprovisioned; N = Duplicate name; G = No such group; L = Unlicensed',
' I = Inactive; D = Dirty or no config; E = Regulatory Domain Mismatch',
' X = Maintenance Mode; P = PPPoE AP; B = Built-in AP; s = LACP striping',
' R = Remote AP; R- = Remote AP requires Auth; C = Cellular RAP;',
' c = CERT-based RAP; 1 = 802.1x authenticated AP; 2 = Using IKE version 2',
' u = Custom-Cert RAP; S = Standby-mode AP; J = USB cert at AP',
' i = Indoor; o = Outdoor',
' M = Mesh node; Y = Mesh Recovery'],
'Total APs': '2',
'AP Database': [{'AP Type': '135',
'Flags': None,
'Group': 'AP Group 1',
'IP Address': '10.0.0.12',
'Name': 'AP 1',
'Standby IP': '0.0.0.0',
'Status': 'Down',
'Switch IP': '10.0.0.10'},
{'AP Type': '277',
'Flags': None,
'Group': 'AP Group 1',
'IP Address': '10.0.0.99',
'Name': 'AP 2',
'Standby IP': '0.0.0.0',
'Status': 'Up 43d:0h:23m:54s',
'Switch IP': '10.0.0.10'}]}
Metadata
Release files for arubaapi 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| arubaapi-0.1.3.tar.gz | 6.3 kB | Without provenance | Details for arubaapi-0.1.3.tar.gz |
Release files / arubaapi-0.1.3.tar.gz
| Download URL | arubaapi-0.1.3.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
331774fd8030dbf72a211f0eb6b7b06237520b5adf3f6823cec5100045c0c2e3
|
|
BLAKE2b-256 checksum How to use checksums |
0147d17999145141e2cc41b6c300f02f3b3b537a5b9e0d8c5f29dc8131fba791
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.4
|
Security for arubaapi 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.