Expose depth and child count on prefix REST API serializer #6501
Labels
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
NetBox version
v2.11.4
Feature type
Change to existing functionality
Proposed functionality
Add two read-only fields to the REST API serializer for the ipam.Prefix model:
_depth
: Depth in the prefix hierarchy (e.g. a root-level prefix will have a depth of zero)children
: The number of child prefixes contained within this prefixThe leading underscore in the name of the depth field is consistent with models which employ MPTT to maintain a hierarchy, such as dcim.Region.
Use case
Following the work implemented under #6087, it is now possible to include this data with no performance impact.
Database changes
No response
External dependencies
No response
The text was updated successfully, but these errors were encountered: