A role for a controller that manages switches, access points and gateways (UniFi Network first; Omada and Instant On fit the same shape), and the VLAN-with-ports getter the switch contract was missing. Both for the UniFi drivers (NetOrk/netork#2787).
NetworkControllerDriver (network_controller, TYPE_LABEL "Network Controller", USES_SSH = False) declares get_managed_devices() -> list[ManagedDeviceDict]: MAC, name, model, role, state, site and address of each managed or pending device; serial, model name, firmware, available firmware and the controller's own id where known. MANAGED_DEVICE_ROLES and MANAGED_DEVICE_STATES name the words.
A managed device can name the driver that polls it (driver) and the optional args that reach it through the controller (driver_args, never a secret), so a caller adds a controller's devices without knowing the vendor and links the controller's credential to them.
Each managed device is polled with a driver of its own. The docstring says so: a controller's get_interfaces/get_lldp_neighbors/get_mac_address_table are its own, never its devices'.
SwitchDriver.get_vlans_detail() and VlanDetailDict (name, tagged, untagged): several switch drivers already offer it and netOrk's poll already reads it; the contract now declares it.
New shapes live in new modules (network_controller_models.py, switch_models.py); models.py does not grow.
Tests: role contract, type label, the new module at 100 %. 2440 passed.
First user: napalm-ubiquiti (unifi_network, unifi_switch, unifi_ap).
Release commit 4.60.0 included; the tag follows the merge.
A role for a controller that manages switches, access points and gateways (UniFi Network first; Omada and Instant On fit the same shape), and the VLAN-with-ports getter the switch contract was missing. Both for the UniFi drivers (NetOrk/netork#2787).
- `NetworkControllerDriver` (`network_controller`, TYPE_LABEL "Network Controller", `USES_SSH = False`) declares `get_managed_devices() -> list[ManagedDeviceDict]`: MAC, name, model, role, state, site and address of each managed or pending device; serial, model name, firmware, available firmware and the controller's own id where known. `MANAGED_DEVICE_ROLES` and `MANAGED_DEVICE_STATES` name the words.
- A managed device can name the driver that polls it (`driver`) and the optional args that reach it through the controller (`driver_args`, never a secret), so a caller adds a controller's devices without knowing the vendor and links the controller's credential to them.
- Each managed device is polled with a driver of its own. The docstring says so: a controller's `get_interfaces`/`get_lldp_neighbors`/`get_mac_address_table` are its own, never its devices'.
- `SwitchDriver.get_vlans_detail()` and `VlanDetailDict` (name, tagged, untagged): several switch drivers already offer it and netOrk's poll already reads it; the contract now declares it.
- New shapes live in new modules (`network_controller_models.py`, `switch_models.py`); `models.py` does not grow.
- Tests: role contract, type label, the new module at 100 %. 2440 passed.
First user: napalm-ubiquiti (`unifi_network`, `unifi_switch`, `unifi_ap`).
Release commit 4.60.0 included; the tag follows the merge.
NetworkControllerDriver (network_controller) is a role for a controller that
manages switches, access points and gateways. It declares
get_managed_devices(), returning ManagedDeviceDict per managed or pending
device; each such device is polled with a driver of its own, so the
controller never reports their ports or neighbours as its own.
SwitchDriver now declares get_vlans_detail() with VlanDetailDict, which
several switch drivers already offered and netOrk's poll already read.
The new shapes live in network_controller_models.py and switch_models.py:
models.py is over the size limit and may not grow.
Refs NetOrk/netork#2787
ManagedDeviceDict gets two optional keys: driver, the entry point that
polls the device, and driver_args, the optional args that reach it through
the controller (never a secret). With them a caller can add a controller's
devices without knowing the vendor (NetOrk/netork#2787).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
A role for a controller that manages switches, access points and gateways (UniFi Network first; Omada and Instant On fit the same shape), and the VLAN-with-ports getter the switch contract was missing. Both for the UniFi drivers (NetOrk/netork#2787).
NetworkControllerDriver(network_controller, TYPE_LABEL "Network Controller",USES_SSH = False) declaresget_managed_devices() -> list[ManagedDeviceDict]: MAC, name, model, role, state, site and address of each managed or pending device; serial, model name, firmware, available firmware and the controller's own id where known.MANAGED_DEVICE_ROLESandMANAGED_DEVICE_STATESname the words.driver) and the optional args that reach it through the controller (driver_args, never a secret), so a caller adds a controller's devices without knowing the vendor and links the controller's credential to them.get_interfaces/get_lldp_neighbors/get_mac_address_tableare its own, never its devices'.SwitchDriver.get_vlans_detail()andVlanDetailDict(name, tagged, untagged): several switch drivers already offer it and netOrk's poll already reads it; the contract now declares it.network_controller_models.py,switch_models.py);models.pydoes not grow.First user: napalm-ubiquiti (
unifi_network,unifi_switch,unifi_ap).Release commit 4.60.0 included; the tag follows the merge.