Closes #20399: Add assigned
and primary
filters for MACAddress
#20620
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.
Fixes: #20399
This PR introduces two boolean filters on
MACAddress
—assigned
andprimary
— to improve filtering capabilities across the UI, REST, and GraphQL. It also adds anis_primary
as a boolean column on the MAC Address table for quick visual scanning.Summary of Changes
assigned
(true ⇒ MACs bound to anyInterface
/VMInterface
; false ⇒ unassigned).primary
(true ⇒ MACs set as the primary MAC on anyInterface
/VMInterface
; false ⇒ all others).is_primary
as a boolean column on the MAC Address table.assigned
andprimary
filters (true/false cases).API Examples
REST
GraphQL
Backward Compatibility
Implementation Notes
is_primary
column is backed by a cached property to avoid repeated lookups while browsing tables.Naming Notes
These filters are currently named
assigned
andprimary
to match existing boolean filter conventions. If the project prefersis_assigned
/is_primary
, I’m happy to adjust.Happy to take any naming or scope adjustments the maintainers prefer. Thanks for the review!