Skip to content

feat: enrich discover snapshot + add read CLI subcommands#9

Merged
ChrisonSimtian merged 1 commit into
mainfrom
feat/46-enrich-discover-cli
Jun 1, 2026
Merged

feat: enrich discover snapshot + add read CLI subcommands#9
ChrisonSimtian merged 1 commit into
mainfrom
feat/46-enrich-discover-cli

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

Enriches the read/discover surface toward the homelab #46 milestone (read/discover/CLI). Write path stays out of scope (tracked separately as BL-011).

Changes

  • UnifiSnapshot / UnifiDiscovery — beyond the old counts + network names, the snapshot now surfaces per-site:
    • Networks/VLANs: name, vlan id, enabled, purpose (management), default
    • WLANs: ssid, enabled, security type, bound-network type
    • Firewall: zones (+ member network ids), zone-based policies (action, src/dest zone, index, enabled), and legacy ACL rules
    • Devices: name, model, mac, ip, firmware, state (full detail)
    • Clients: name, type, ip, connectedAt (full detail)
  • CLI — new networks, wlans, firewall, devices, clients subcommands (kept sites, discover); JSON, env-driven, consistent with the existing pattern. README updated.
  • Tests — 3 new snapshot unit tests; live [SkippableFact] extended to assert the enriched sections populate (skips without UNIFI_*).

Generated endpoints used (all under client.V1.Sites[id]): Networks, Wifi.Broadcasts, Firewall.Zones, Firewall.Policies, AclRules, Devices, Clients.

Not covered (API limitations)

  • Port profiles — the official integration client exposes no port-profile endpoint (only per-port runtime state). Can't surface these via the supported API.
  • Network subnet / WLAN band — not present in the integration models; surfaced the closest available fields.

Verification

  • dotnet build clean (regen-on-build from openapi.10.4.57.json); dotnet test = 6 passed, 2 skipped (live tests skip without creds).

🤖 Generated with Claude Code

Expand the read/discover milestone beyond counts + network names to the
detail issue #46 names, using the Kiota-generated read endpoints.

Snapshot (UnifiSnapshot/UnifiDiscovery):
- networks/VLANs: name, vlan id, enabled, purpose (management role), default
- WLANs: ssid, enabled, security type, bound network type
- firewall: zones (+ network ids), zone-based policies (action, src/dst zone,
  index, enabled), and legacy ACL rules (type, action, index, enabled)
- devices: name, model, mac, ip, firmware, state (not just count)
- clients: name, type, ip, connectedAt (not just count)
- counts retained as deviceCount/clientCount

CLI: add networks | wlans | firewall | devices | clients subcommands
(JSON, env-driven), alongside existing sites | discover.

Tests: add UnifiSnapshotTests (record shape + JSON round-trip); extend the
live [SkippableFact] to assert enriched sections populate (skips without
UNIFI_* env).

Write path stays out of scope (deferred to BL-011). Port profiles are not
covered — the generated integration client exposes no port-profile endpoint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisonSimtian
ChrisonSimtian merged commit 0d56b09 into main Jun 1, 2026
1 check passed
@ChrisonSimtian
ChrisonSimtian deleted the feat/46-enrich-discover-cli branch June 1, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant