Filtering for child devices by parent device #5948

Closed
opened 2025-12-29 19:34:40 +01:00 by adam · 3 comments
Owner

Originally created by @Alestor on GitHub (Jan 15, 2022).

Originally assigned to: @stephanblanke on GitHub.

NetBox version

v3.1.5

Feature type

Change to existing functionality

Proposed functionality

I think a query option to identify all child devices of a parent device would be a good enhancement. For example to find all blade server associated with an enclosure or all network modules of a networking device. From the Web UI it's currently ok to get such overview by selecting a parent device and look on the device-bay tab for the child devices.
To get such overview from the REST API is currently more tricky. First you have to identify the device id of the parent device. Next it's necessary to get all devices which may be associated with the parent device and filter the JSON for results[].parent_device.id .

Use case

Being able to query child devices by parent_device_id on the API call, would make some automation tasks more easy to realize. In addition it should slightly reduce the load on the app server, since it's no more necessary to make queries with large result sets.

Database changes

None that I'm aware of.

External dependencies

None

Originally created by @Alestor on GitHub (Jan 15, 2022). Originally assigned to: @stephanblanke on GitHub. ### NetBox version v3.1.5 ### Feature type Change to existing functionality ### Proposed functionality I think a query option to identify all child devices of a parent device would be a good enhancement. For example to find all blade server associated with an enclosure or all network modules of a networking device. From the Web UI it's currently ok to get such overview by selecting a parent device and look on the device-bay tab for the child devices. To get such overview from the REST API is currently more tricky. First you have to identify the device id of the parent device. Next it's necessary to get all devices which may be associated with the parent device and filter the JSON for results[].parent_device.id . ### Use case Being able to query child devices by parent_device_id on the API call, would make some automation tasks more easy to realize. In addition it should slightly reduce the load on the app server, since it's no more necessary to make queries with large result sets. ### Database changes None that I'm aware of. ### External dependencies None
adam added the status: acceptedtype: feature labels 2025-12-29 19:34:40 +01:00
adam closed this issue 2025-12-29 19:34:44 +01:00
Author
Owner

@github-actions[bot] commented on GitHub (Mar 17, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Mar 17, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@stephanblanke commented on GitHub (Mar 19, 2022):

I can try to implement this

@stephanblanke commented on GitHub (Mar 19, 2022): I can try to implement this
Author
Owner

@jeremystretch commented on GitHub (Mar 30, 2022):

@stephanblanke are you still interested in working on this?

@jeremystretch commented on GitHub (Mar 30, 2022): @stephanblanke are you still interested in working on this?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5948