Skip to content

REST API: dcim/interfaces has count_ipaddresses, while virtualization/interfaces does not #6070

@eikef

Description

@eikef

NetBox version

v2.10.6

Feature type

Change to existing functionality

Proposed functionality

Currently the /api/dcim/interfaces-endpoint provides a convenient read-only count_ipaddresses field in its return, whereas the /api/virtualization/interfaces-endpoint does not -- although the latter can have IP addresses assigned just like the former and is otherwise very similar in its usage.

I would propose the count_ipaddresses-field to be exposed via the REST API for /api/virtualization/interfaces the same as it is now for /api/dcim/interfaces, for both consistency and utility; if that is not indended, then maybe the count_ipaddresses-field should be deprecated on /api/dcim/interfaces so one does not get bitten by assuming it to be there when using both APIs in similar code.

Use case

Consistency in the API between /api/dcim/interfaces and /api/virtualization/interfaces; personally was surprised when the field was unavailable in one but not the other.

There is utility in the count_ipaddresses field in that it can save unnecessary API calls.

Database changes

No response

External dependencies

No response

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions