Allow filtering IP addresses by Family in GraphQL API #11235

Closed
opened 2025-12-29 21:42:18 +01:00 by adam · 5 comments
Owner

Originally created by @mraerino on GitHub (May 30, 2025).

Originally assigned to: @mraerino on GitHub.

NetBox version

v4.3.1

Feature type

Change to existing functionality

Proposed functionality

I would like to be able to filter list of IP addresses in the graphQL API by their IP version (4 or 6).

This would make queries like these work:

{
  ip_address_list(filters: {family: FAMILY_6}) {
    address
  }
}
{
  device_list {
    interfaces {
      ip_addresses(filters: {family: FAMILY_6}) {
        address
      }
    }
  }
}

Use case

We're using graphql to gather input to our configuration management. Sometimes we need just IP addresses of a certain family (e.g. when a tool is single-stacked).

This used to be possible in versions prior to 4.3.x

The REST API allows filtering IP addresses using the family query param.

Database changes

None

External dependencies

None

Originally created by @mraerino on GitHub (May 30, 2025). Originally assigned to: @mraerino on GitHub. ### NetBox version v4.3.1 ### Feature type Change to existing functionality ### Proposed functionality I would like to be able to filter list of IP addresses in the graphQL API by their IP version (4 or 6). This would make queries like these work: ```gql { ip_address_list(filters: {family: FAMILY_6}) { address } } ``` ```gql { device_list { interfaces { ip_addresses(filters: {family: FAMILY_6}) { address } } } } ``` ### Use case We're using graphql to gather input to our configuration management. Sometimes we need just IP addresses of a certain family (e.g. when a tool is single-stacked). This used to be possible in versions prior to 4.3.x The REST API allows filtering IP addresses using the `family` query param. ### Database changes None ### External dependencies None
adam added the status: acceptedtype: featurecomplexity: low labels 2025-12-29 21:42:18 +01:00
adam closed this issue 2025-12-29 21:42:18 +01:00
Author
Owner

@mraerino commented on GitHub (May 30, 2025):

Note: I'm willing to implement this

@mraerino commented on GitHub (May 30, 2025): Note: I'm willing to implement this
Author
Owner

@arthanson commented on GitHub (May 30, 2025):

@mraerino would you be okay as re-opening this as a bug just for better tracking and close this FR? I think this filter just got missed, I can then assign for you to work on.

@arthanson commented on GitHub (May 30, 2025): @mraerino would you be okay as re-opening this as a bug just for better tracking and close this FR? I think this filter just got missed, I can then assign for you to work on.
Author
Owner

@mraerino commented on GitHub (May 30, 2025):

@arthanson I first reported this as a bug but it was closed asking for a feature request.

https://github.com/netbox-community/netbox/issues/19476

@mraerino commented on GitHub (May 30, 2025): @arthanson I first reported this as a bug but it was closed asking for a feature request. https://github.com/netbox-community/netbox/issues/19476
Author
Owner

@arthanson commented on GitHub (May 30, 2025):

Ah sorry about that @mraerino will keep it here then.

@arthanson commented on GitHub (May 30, 2025): Ah sorry about that @mraerino will keep it here then.
Author
Owner

@mraerino commented on GitHub (Jun 1, 2025):

PR is open

@mraerino commented on GitHub (Jun 1, 2025): PR is open
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11235