Enhance device & link listing with additional filters & ourput columns#2813
Open
juan-malbeclabs wants to merge 5 commits intomainfrom
Open
Enhance device & link listing with additional filters & ourput columns#2813juan-malbeclabs wants to merge 5 commits intomainfrom
juan-malbeclabs wants to merge 5 commits intomainfrom
Conversation
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.
Summary
Add comprehensive filtering capabilities to device list and link list CLI commands
Add desired_status & metrics_publisher_pk field to device list output (hidden from table, visible in JSON)
Add extensive test coverage for all new filters
Changes
Device List Enhancements
New Filters:
--exchange - Filter by exchange (pubkey or code)
--location - Filter by location (pubkey or code)
--device-type - Filter by type (hybrid, transit, edge)
--status - Filter by status (pending, activated, deleting, rejected, drained, device-provisioning, link-provisioning)
--health - Filter by health (unknown, pending, ready-for-links, ready-for-users, impaired)
--desired-status - Filter by desired status (pending, activated, drained)
--code - Filter by device code with partial match
New Field:
Added metrics_publisher_pk to DeviceDisplay struct, marked with #[tabled(skip)] so it appears in JSON output but not in table view
Link List Enhancements
New Filters:
--side-a - Filter by side A device (pubkey or code)
--side-z - Filter by side Z device (pubkey or code)
--link-type - Filter by link type (WAN, DZX) - complements existing --wan and --dzx boolean flags
--status - Filter by status (pending, activated, deleting, rejected, drained)
--health - Filter by health (unknown, pending, ready-for-service, impaired)
--desired-status - Filter by desired status (pending, activated, drained)
--code - Filter by link code with partial match
Filter Behavior
All filters can be combined for complex queries
Exchange, location, and device filters accept both pubkeys and codes
Code filters use partial matching (substring search)
Other filters require exact matches
Invalid filter values return descriptive error messages
Testing
Added comprehensive test coverage:
Device tests: 5 tests covering device_type, code, status, and combined filters
Link tests: 5 tests covering link_type, side_a, code filtering
Examples
Device filtering
Link filtering
Combined filters
Testing Verification