Expand Rack endpoint to include non-racked devices #3924

Closed
opened 2025-12-29 18:32:06 +01:00 by adam · 3 comments
Owner

Originally created by @soer7022 on GitHub (Jul 30, 2020).

Proposed Functionality

Currently the Rack endpoint displays how many devices it houses, I would like to expand this functionality to be more specific.
I propose an extra field called: nonRackedDevices that indicates how many of these devices that are non-racked

Use Case

This would be useful when interacting with the api for rack capacity reasons, we have a rack that only contains 1U devices but also have some non-racked devices such as PDU's. We would then subtract the non-racked devices from the device count and compare this to the height of the rack, to know how much space was left.

Database Changes

Extra field for non-racked devices

External Dependencies

None

Originally created by @soer7022 on GitHub (Jul 30, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/forum/#!forum/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality Currently the Rack endpoint displays how many devices it houses, I would like to expand this functionality to be more specific. I propose an extra field called: `nonRackedDevices` that indicates how many of these devices that are non-racked <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case This would be useful when interacting with the api for rack capacity reasons, we have a rack that only contains 1U devices but also have some non-racked devices such as PDU's. We would then subtract the non-racked devices from the device count and compare this to the height of the rack, to know how much space was left. <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes Extra field for non-racked devices <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies None
adam added the type: feature label 2025-12-29 18:32:06 +01:00
adam closed this issue 2025-12-29 18:32:06 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 30, 2020):

This would be useful when interacting with the api for rack capacity reasons, we have a rack that only contains 1U devices but also have some non-racked devices such as PDU's.

This seems like a very niche use case. Generally speaking, it's not reasonable to assume that all devices within a rack are 1U, so determining utilization isn't as simple as counting the number of installed devices. This also totally ignores the concept of device depth: it's perfectly plausible to have more than 42 half-depth devices in a 42U rack, for instance.

The recommended approach for determining a rack's capacity is to fetch the elevation for a particular face (e.g. GET /api/dcim/racks/<id>/elevation/?face=front). This data allows for easily calculating the amount of used and available space within a rack.

@jeremystretch commented on GitHub (Jul 30, 2020): > This would be useful when interacting with the api for rack capacity reasons, we have a rack that only contains 1U devices but also have some non-racked devices such as PDU's. This seems like a very niche use case. Generally speaking, it's not reasonable to assume that all devices within a rack are 1U, so determining utilization isn't as simple as counting the number of installed devices. This also totally ignores the concept of device depth: it's perfectly plausible to have more than 42 half-depth devices in a 42U rack, for instance. The recommended approach for determining a rack's capacity is to fetch the elevation for a particular face (e.g. `GET /api/dcim/racks/<id>/elevation/?face=front`). This data allows for easily calculating the amount of used and available space within a rack.
Author
Owner

@soer7022 commented on GitHub (Jul 31, 2020):

After writing this issue I made some simple logic in my frontend application to do this.

I agree that this is very niche, but it might still be useful to know the amount of non-racked devices, as it shows on the page for the rack.

@soer7022 commented on GitHub (Jul 31, 2020): After writing this issue I made some simple logic in my frontend application to do this. I agree that this is very niche, but it might still be useful to know the amount of non-racked devices, as it shows on the page for the rack.
Author
Owner

@jeremystretch commented on GitHub (Sep 1, 2020):

I'm going to decline this as there's been no further discussion. As indicated above, there already exists a mechanism for fetching the desired information.

@jeremystretch commented on GitHub (Sep 1, 2020): I'm going to decline this as there's been no further discussion. As indicated above, there already exists a mechanism for fetching the desired information.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3924