-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Copy link
Labels
complexity: lowRequires minimal effort to implementRequires minimal effort to implementstatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the applicationIntroduction of new functionality to the application
Milestone
Description
NetBox version
v4.2.6
Feature type
New functionality
Proposed functionality
Add primary_ip4
and primary_ip6
filters to ipam.filtersets.PrimaryIPFilterSet
Use case
In our use cases we need to get virtual machine or device by their primary IP. Now we do this in two requests:
- find IP address id by
api/ipam/ip-addresses/?address=1.1.1.1/32
- find device or VM by filtering
api/dcim/devices/?primary_ip4_id=<ip_id>
I propose to add filtering by IP address directly, so users can do it only in one request: api/dcim/devices/?primary_ip4=1.1.1.1/32
. This will decrease the number of requests and time to complete.
If the issue is accepted, I would be glad to submit a PR.
Database changes
None
External dependencies
None
Metadata
Metadata
Assignees
Labels
complexity: lowRequires minimal effort to implementRequires minimal effort to implementstatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the applicationIntroduction of new functionality to the application