Bring back GraphQL reverse search for IP-Addresses based on device #11672

Closed
opened 2025-12-29 21:48:20 +01:00 by adam · 1 comment
Owner

Originally created by @dxks on GitHub (Oct 2, 2025).

NetBox version

v4.4.2

Feature type

Data model extension

Proposed functionality

With NetBox 4.2 it was possible to perform a graphql query to retrieve all IP-Addresses that belongs in any kind to a device:

query { ip_address_list(filters:{device_id:"4711"}) { id address }}

Unfortunately with the new Filtering this option has gone and now only a forward search over interfaces and services and manually combining it is possible as there cannot be build a relationship in the filters between an ip address and a device. The REST API still works but with no chance to add additional data in the query, i.e. services or nat bound to that ip.

Use case

Retrieve all ip addresses for a device and define the retrieved data and further relationships.

Database changes

No response

External dependencies

No response

Originally created by @dxks on GitHub (Oct 2, 2025). ### NetBox version v4.4.2 ### Feature type Data model extension ### Proposed functionality With NetBox 4.2 it was possible to perform a graphql query to retrieve all IP-Addresses that belongs in any kind to a device: `query { ip_address_list(filters:{device_id:"4711"}) { id address }}` Unfortunately with the new Filtering this option has gone and now only a forward search over interfaces and services and manually combining it is possible as there cannot be build a relationship in the filters between an ip address and a device. The REST API still works but with no chance to add additional data in the query, i.e. services or nat bound to that ip. ### Use case Retrieve all ip addresses for a device and define the retrieved data and further relationships. ### Database changes _No response_ ### External dependencies _No response_
adam added the type: featurenetboxtopic: GraphQL labels 2025-12-29 21:48:20 +01:00
adam closed this issue 2025-12-29 21:48:20 +01:00
Author
Owner

@jnovinger commented on GitHub (Oct 2, 2025):

For the moment, you can query through the device relationship to get all IP addresses:

query {
  device(id: 4711) {
    interfaces {
      ip_addresses {
        id
        address
        # Additional fields as needed
      }
    }
    services {
      ipaddresses {
        id
        address
      }
    }
  }
}

This requires client-side flattening but should get you all IPs for a device.

@jnovinger commented on GitHub (Oct 2, 2025): For the moment, you can query through the device relationship to get all IP addresses: ```graphql query { device(id: 4711) { interfaces { ip_addresses { id address # Additional fields as needed } } services { ipaddresses { id address } } } } ``` This requires client-side flattening but should get you all IPs for a device.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11672