Skip to content

Add Prefix utilization to API #9649

@empusas

Description

@empusas

NetBox version

v3.2.6

Feature type

New functionality

Proposed functionality

Add the prefix utilization to the API. The utilization is a useful information for people who use the Netbox API for their own automation.
The code to add is simple as the models.py for IPAM has already the required function used by the Web UI.

Code to add to the prefix serializer:

utilization = serializers.SerializerMethodField('get_utilization')

def get_utilization(self, obj):
    utilization = obj.get_utilization()
    return utilization

I am happy to make the changes and create a pull request if the feature is accepted.

Use case

API users get the utilization of a prefix in a percentage value. That would be helpful to create reports or get an overview about IP usage.

Database changes

NA

External dependencies

NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    netboxstatus: duplicateThis issue has already been raisedtype: featureIntroduction of new functionality to the application

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions