Allow VirtualMachine and Device filter by IP address from Primary IP #19110
Labels
complexity: low
Requires minimal effort to implement
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
Milestone
Uh oh!
There was an error while loading. Please reload this page.
NetBox version
v4.2.6
Feature type
New functionality
Proposed functionality
Add
primary_ip4
andprimary_ip6
filters toipam.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:
api/ipam/ip-addresses/?address=1.1.1.1/32
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
The text was updated successfully, but these errors were encountered: