Asynchronous client for the Aruba Instant REST API
Project description
aioarubainstant
aioarubainstant is a typed asynchronous Python client for the monitoring API
on Aruba Instant controllers. It is designed for Home Assistant integrations
but has no Home Assistant dependency or entity logic.
Version 0.1.1 supports Python 3.14 and Aruba Instant 8.6 monitoring commands.
Features
- HTTPS communication with
aiohttpon port 4343 by default - Configurable TLS certificate verification
- SID authentication, reuse, and one automatic reauthentication attempt
- Serialized controller commands to avoid overlapping CLI requests
- Caller-provided
aiohttp.ClientSessionsupport - Async context-manager and explicit cleanup APIs
- Typed immutable cluster, access-point, client, and snapshot models
- Header-derived table parsing tolerant of reordered and additional columns
- Sanitized raw command output retained privately for diagnostics
The supported commands are show aps, show client debug, show summary, and
show version. The library never issues a per-client
show client status <mac> request.
Controller setup
The REST API is disabled by default and is available only through the master AP in a cluster. Enable it from the Aruba Instant CLI:
(Instant AP)(config)# allow-rest-api
(Instant AP)(config)# end
(Instant AP)# commit-apply
The transport and response behavior follow the Aruba Instant 8.6.0.x REST API Guide. Command output formats follow the official Instant AOS-8.x CLI Reference Guide, including its Instant AOS-8.6 command history and examples.
Installation
python -m pip install aioarubainstant==0.1.1
Usage
import asyncio
from aioarubainstant import ArubaInstantClient
async def main() -> None:
async with ArubaInstantClient(
"192.0.2.1",
"admin",
"controller-password",
verify_ssl=True,
) as client:
snapshot = await client.async_get_snapshot()
print(snapshot.cluster.name, snapshot.cluster.version)
for access_point in snapshot.access_points:
print(access_point.name, access_point.connected_clients)
for wireless_client in snapshot.clients:
print(wireless_client.hostname, wireless_client.associated_ap)
asyncio.run(main())
Controllers commonly use a private certificate. Prefer an ssl.SSLContext
that trusts the controller CA. Set verify_ssl=False only when certificate
verification is intentionally disabled.
Some Aruba Instant firmware emits a malformed response header that aiohttp
rejects when PYTHONASYNCIODEBUG enables strict response parsing. A client
using its internally owned HTTP session scopes Aruba-compatible response
parsing to that controller connection without disabling asyncio debug globally.
This compatibility behavior is included in version 0.1.1.
For a caller-owned HTTP session:
import aiohttp
from aioarubainstant import ArubaInstantClient
async with aiohttp.ClientSession() as session:
client = ArubaInstantClient(
"controller.example.com",
"admin",
"controller-password",
session=session,
)
snapshot = await client.async_get_snapshot()
await client.async_close()
async_close() logs out but never closes a caller-provided session.
Caller-provided sessions also retain their own connector and response-parser
behavior; they do not use the Aruba-specific compatibility connector.
Public contract
The package exports:
ArubaInstantClientasync_get_snapshot()ArubaInstantSnapshotArubaClusterArubaAccessPointArubaClient
See Package Usage for the complete model, exception, TLS, and integration contract.
Model fields are immutable. A field is None when the controller did not
report it; the package does not invent placeholder values. A snapshot contains
one ArubaCluster, tuples of access points and clients, and private sanitized
raw output for diagnostics.
Client counts are never derived by counting parsed records. The cluster total
comes from the controller-reported value in show summary, and each AP's count
comes from the Clients field in show aps. Parsed show client debug rows
provide client details only.
The exception hierarchy is rooted at ArubaInstantError:
ArubaInstantAuthenticationError: login credentials were rejectedArubaInstantConnectionError: controller connection or HTTP failureArubaInstantTimeoutError: request timeout; also a connection errorArubaInstantRestDisabledError: REST API is not enabledArubaInstantNotMasterError: REST request was sent to a non-master APArubaInstantSessionError: invalid or expired SID after the allowed retryArubaInstantCommandError: controller rejected or failed a commandArubaInstantParseError: malformed JSON or unsupported command output
Passwords and session IDs are never logged. Do not place controller, GitHub, PyPI, or Codex credentials in this repository.
Home Assistant
Use this exact manifest dependency for version 0.1.1:
"requirements": ["aioarubainstant==0.1.1"]
Home Assistant can rely on immutable snapshots, stable MAC-address client identity, AP/client association, master resolution, explicit zero-client collections, and the exception contract above.
Development
Open the repository in VS Code and run
Dev Containers: Rebuild and Reopen in Container. The container provides
Python 3.14, uv, Ruff, mypy, pytest, build tools, PDF inspection utilities,
and GitHub CLI.
The host ${HOME}/.codex directory is bind-mounted to /home/vscode/.codex.
The uv cache is persisted separately in a named volume. No authentication
data is copied into the image or repository.
Maintainers and coding agents should read Repository Guidance and Project Notes before changing command selection, parsing, count provenance, or release automation.
For the planned Home Assistant Core migration, use the reusable Home Assistant Codex goal prompt.
Run the complete local checks with:
uv sync --all-extras --dev
uv run ruff check src tests
uv run ruff format --check src tests
uv run mypy src tests
uv run pytest
uv build
uv run twine check dist/*
Real-controller smoke test
The real-controller test is a separate local developer tool. It is not run by CI or by the release workflow. Invoke it explicitly when an Aruba Instant AP is available:
uv run python scripts/check_real_ap.py controller.example.com admin
The script prompts for the controller password without placing it in shell
history or process arguments. TLS certificate verification is enabled by
default. Use --ca-file controller-ca.pem for a private controller CA, or
--insecure only for an intentional local test. By default it validates each
supported command independently, validates the combined snapshot, and prints a
privacy-safe structural report without raw output, passwords, or session IDs.
To validate one command in isolation:
uv run python scripts/check_real_ap.py controller.example.com admin --insecure \
--validate-command "show client debug"
Focused command validation prints that command's raw output before the validation result. The default all-command validation remains privacy-safe and does not print raw output.
To print only the controller's raw show summary output for manual inspection:
uv run python scripts/check_real_ap.py controller.example.com admin --insecure --show-summary
Use --show-command to inspect another supported command, for example:
uv run python scripts/check_real_ap.py controller.example.com admin --insecure \
--show-command "show client debug"
Raw command output may contain controller names, network addresses, client MAC addresses, or other private data. Do not publish it without reviewing and redacting those values.
Release publishing
GitHub releases trigger .github/workflows/release.yml, which builds and
validates the distributions before publishing through PyPI trusted publishing.
The trusted publisher is configured for owner apaperclip, repository
aioarubainstant, workflow release.yml, and environment pypi. No PyPI
token is stored in GitHub or this repository.
Version 0.1.1 is available from PyPI and the GitHub release.
License
Apache License 2.0. See LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aioarubainstant-0.1.1.tar.gz.
File metadata
- Download URL: aioarubainstant-0.1.1.tar.gz
- Upload date:
- Size: 92.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c29768490345e968a89126d844e9a74e21969c613cc2094b9d211199be79033
|
|
| MD5 |
3989de41360be66d02cae00b6d80f165
|
|
| BLAKE2b-256 |
ca973466e5c114e2e4f92900c3280fb4ad62c2bb81237686c1b4861b9b5d7630
|
Provenance
The following attestation bundles were made for aioarubainstant-0.1.1.tar.gz:
Publisher:
release.yml on apaperclip/aioarubainstant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aioarubainstant-0.1.1.tar.gz -
Subject digest:
1c29768490345e968a89126d844e9a74e21969c613cc2094b9d211199be79033 - Sigstore transparency entry: 1819537953
- Sigstore integration time:
-
Permalink:
apaperclip/aioarubainstant@9549a226d63abe1fff5c0e6530c150049e95d31b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/apaperclip
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9549a226d63abe1fff5c0e6530c150049e95d31b -
Trigger Event:
release
-
Statement type:
File details
Details for the file aioarubainstant-0.1.1-py3-none-any.whl.
File metadata
- Download URL: aioarubainstant-0.1.1-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6d19c390e11e58d4dd83c96e3d510ced3eaf60cffdf30d1f0eddb5f5cd7b463
|
|
| MD5 |
22c4b3b206185feafd31849b9244f3ef
|
|
| BLAKE2b-256 |
3abf0a35d67fc476913028b1e927ab4aa37a1da31c08d38916539713e2abc231
|
Provenance
The following attestation bundles were made for aioarubainstant-0.1.1-py3-none-any.whl:
Publisher:
release.yml on apaperclip/aioarubainstant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aioarubainstant-0.1.1-py3-none-any.whl -
Subject digest:
b6d19c390e11e58d4dd83c96e3d510ced3eaf60cffdf30d1f0eddb5f5cd7b463 - Sigstore transparency entry: 1819538005
- Sigstore integration time:
-
Permalink:
apaperclip/aioarubainstant@9549a226d63abe1fff5c0e6530c150049e95d31b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/apaperclip
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9549a226d63abe1fff5c0e6530c150049e95d31b -
Trigger Event:
release
-
Statement type: