API reference¶
Complete reference for every module in the netgear_switch package,
generated from the source.
Most callers need only Core types (the data model, the registry, the
capability oracle) and Facades (SyncSwitch and AsyncSwitch).
The rest serves anyone reading the source, extending a backend, or building on
the protocol layer directly.
Layering¶
sync_api.py / aio_api.py facades: pick ONE backend, no fallback
│
├── _dispatch.py backend resolution + lazy client builders
│
┌────────┴───────────────────────────────┐
snmp_read/write nsdp_read/write model-driven operations
http_read/write cli_read/write
│
protocols/… pure protocol knowledge, no I/O
│
transport/… sockets, subprocesses, sessions
registry.py, models.py, errors.py, capabilities.py and
config.py sit beside all of it: every layer uses them, none of them imports a
layer.
The package namespace¶
Python Netgear Switch Interface Library.
Query and control Netgear switches over SNMP, NSDP, the HTTP web UI and the CLI behind one model-driven API.
Warning
This library was written by an AI – every line of code, every test and all of its documentation – with a human directing and reviewing the work. The device behaviour it encodes is measured against real hardware (captured traffic and live runs, recorded with the host and firmware version observed), and the support tables in the documentation are generated from the code. But an AI is capable of confident, fluent error, and none of this has had independent human review at scale. Verify what matters to you.
Design principles (non-negotiable – see CLAUDE.md at the repository root for
the rationale and the real-world violation behind each one):
Fail fast and loud. An operation that cannot be performed as asked raises, with the detail needed to debug it. Nothing is papered over, and a request for one backend is NEVER silently served by another – switching protocol mid-operation is forbidden.
Backends have parity. Every backend a model supports offers the same functionality, so the CALLER can choose one (e.g. when SNMP writes are locked down). A missing operation is a missing implementation, not a device limitation, unless captured device output proves otherwise.
Models have parity. A feature is done when it works on every registered model, verified per model. Firmware differs between SKUs of the same family – never extrapolate from one to another.
A failure is a bug here first. Not flaky hardware, not a timeout. Check credentials, prerequisite settings, value types and operation ordering before even considering a device limitation.
The virtual switch must behave like the real hardware, including its refusals, quirks and ordering requirements. Where the fake differs from a real device, the fake is what gets fixed.
Everything in __all__ is re-exported at the top level, so
from netgear_switch import SyncSwitch, Backend, VlanMode is the intended
import style. The pages that follow document each name where it is defined.