Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way of determining prefix percent utilization to the API #10778

Closed
ajm5774 opened this issue Oct 27, 2022 · 2 comments
Closed

Add a way of determining prefix percent utilization to the API #10778

ajm5774 opened this issue Oct 27, 2022 · 2 comments
Labels
status: duplicate This issue has already been raised type: feature Introduction of new functionality to the application

Comments

@ajm5774
Copy link

ajm5774 commented Oct 27, 2022

NetBox version

v3.3.6

Feature type

New functionality

Proposed functionality

Add way of determining prefix percent utilization to the API. The percent utilization is shown through the UI but it not accessible through the API. Currently there is no easy way of determining the percent utilization because we are lacking:

  1. The prefix capacity. This can be estimated with 2**(32-netmask_length) - 2 but this rarely aligns with the values that are shown through the UI.
  2. A way of getting the total number of available or unavailable IPs for a prefix. The UI has an endpoint for seeing the IPs associated with a prefix, but not the API. The Closest thing is to use an endpoint like the following https://demo.netbox.dev/api/ipam/ip-addresses/?parent=172.16.0.0/16 but this rarely aligns with what is shown through the UI. As for the number of available IPs see this ticket.

My proposal to accomplish this ask:

  1. Add prefix capacity to the prefix API object (https://demo.netbox.dev/api/ipam/prefixes/75/)
  2. Address issue 10777

It may also be beneficial to have an endpoint for listing IPs associated with a prefix for other use cases (something like https://demo.netbox.dev/api/ipam/prefixes/75/ip-addresses), so along with being able to list all available IPs we could at least calculate the prefix capacity on our own.

Use case

We do alerting on prefixes that have a utilization over a certain percent so that we know when we are getting low on IP addresses. We use percent utilization because the number of available IPs we want to alert on is different depending on the size of the prefix and the rate at which IPs are assigned is generally proportional to the size of the prefix.

Company: Datto, a Kaseya Company

Database changes

No response

External dependencies

No response

@ajm5774 ajm5774 added the type: feature Introduction of new functionality to the application label Oct 27, 2022
@PieterL75
Copy link
Contributor

See #6606 and #7292 and #9649

@jeremystretch
Copy link
Member

Thank you for submitting this issue, however it appears that this topic has already been raised. Please see issue #9649 for further discussion.

@jeremystretch jeremystretch closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2023
@jeremystretch jeremystretch added the status: duplicate This issue has already been raised label Jan 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: duplicate This issue has already been raised type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

3 participants