feat: enrich discover snapshot + add read CLI subcommands#9
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:management), defaultnetworks,wlans,firewall,devices,clientssubcommands (keptsites,discover); JSON, env-driven, consistent with the existing pattern. README updated.[SkippableFact]extended to assert the enriched sections populate (skips withoutUNIFI_*).Generated endpoints used (all under
client.V1.Sites[id]):Networks,Wifi.Broadcasts,Firewall.Zones,Firewall.Policies,AclRules,Devices,Clients.Not covered (API limitations)
Verification
dotnet buildclean (regen-on-build fromopenapi.10.4.57.json);dotnet test= 6 passed, 2 skipped (live tests skip without creds).🤖 Generated with Claude Code