Implement contains filter for IPAM prefixes and IP ranges #1523

Closed
opened 2026-04-06 02:58:22 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @mraerino on 8/3/2025

Fixes: #19812

This adds a contains filter on both Prefixes and IP Ranges.

Example queries:

query prefixes {
  prefix_list(filters: {contains: ["10.1.0.0"]}) {
    prefix
  }
}

query ipranges {
  ip_range_list(filters: {contains: ["10.2.1.0/24"]}) {
    start_address
    end_address
  }
}

The query will throw an error if the given subnet cannot be parsed. A missing prefixlength on the filter argument is interpreted as /128//32 (depending on the family)

*Originally created by @mraerino on 8/3/2025* ### Fixes: #19812 This adds a `contains` filter on both Prefixes and IP Ranges. Example queries: ```gql query prefixes { prefix_list(filters: {contains: ["10.1.0.0"]}) { prefix } } query ipranges { ip_range_list(filters: {contains: ["10.2.1.0/24"]}) { start_address end_address } } ``` The query will throw an error if the given subnet cannot be parsed. A missing prefixlength on the filter argument is interpreted as `/128`/`/32` (depending on the family)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#1523