Make Prefix Utilization and Aggregate Utilization available via API #5380

Open
opened 2025-12-29 19:27:20 +01:00 by adam · 3 comments
Owner

Originally created by @emallette on GitHub (Sep 17, 2021).

NetBox version

v2.11.12

Feature type

Data model extension

Proposed functionality

Currently, the UI displays the utilization for prefixes and aggregates - like that functionality. We would like to obtain the utilization via API as well. It appears that the utilization is being calculated on the fly to display in the API. Could you expose that to the API ?

Use case

There are a number of cases where it would be helpful:

  1. We are programmatically allocating prefixes as part of our ordering system and today we are simply attempting to allocate prefix size FOO from block A, on failure we move to block B. We would like to be able to see the utilization of a block and quickly determine whether or not to attempt to allocate from that prefix or container.

  2. We would like to be able to quickly generate our own utilization reports using the calculations already performed in Netbox rather than re-writing the same allocation logic and this would be helpful.

Database changes

No response

External dependencies

No response

Originally created by @emallette on GitHub (Sep 17, 2021). ### NetBox version v2.11.12 ### Feature type Data model extension ### Proposed functionality Currently, the UI displays the utilization for prefixes and aggregates - like that functionality. We would like to obtain the utilization via API as well. It appears that the utilization is being calculated on the fly to display in the API. Could you expose that to the API ? ### Use case There are a number of cases where it would be helpful: 1) We are programmatically allocating prefixes as part of our ordering system and today we are simply attempting to allocate prefix size FOO from block A, on failure we move to block B. We would like to be able to see the utilization of a block and quickly determine whether or not to attempt to allocate from that prefix or container. 2) We would like to be able to quickly generate our own utilization reports using the calculations already performed in Netbox rather than re-writing the same allocation logic and this would be helpful. ### Database changes _No response_ ### External dependencies _No response_
adam added the type: featurestatus: blockednetbox labels 2025-12-29 19:27:20 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 17, 2021):

This was recently proposed under #6606 and did not seem to generate any interest. Please see my comment here on the likely avenues for implementation.

@emallette are you interested in owning this work?

@jeremystretch commented on GitHub (Sep 17, 2021): This was recently proposed under #6606 and did not seem to generate any interest. Please see my comment [here](https://github.com/netbox-community/netbox/issues/6606#issuecomment-861509565) on the likely avenues for implementation. @emallette are you interested in owning this work?
Author
Owner

@jeremystretch commented on GitHub (Oct 5, 2021):

As I commented here, implementing this elegantly will probably require that we first pre-render utilization data for all aggregates, prefixes, and ranges. I've opened #7451 to explore the idea. This proposal should be considered blocked until a decision has been made on #7451.

@jeremystretch commented on GitHub (Oct 5, 2021): As I commented [here](https://github.com/netbox-community/netbox/issues/6606#issuecomment-861509565), implementing this elegantly will probably require that we first pre-render utilization data for all aggregates, prefixes, and ranges. I've opened #7451 to explore the idea. This proposal should be considered blocked until a decision has been made on #7451.
Author
Owner

@jeremystretch commented on GitHub (Dec 22, 2021):

Also related to #7845

@jeremystretch commented on GitHub (Dec 22, 2021): Also related to #7845
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5380