Add has_primary_ip filtering to virtual machines #4165

Closed
opened 2025-12-29 18:33:35 +01:00 by adam · 1 comment
Owner

Originally created by @rodvand on GitHub (Oct 5, 2020).

Originally assigned to: @jeremystretch on GitHub.

Environment

  • Python version: 3.7.5
  • NetBox version: 2.9.3

Proposed Functionality

Add the has_primary_ip filter which is currently available for devices to virtual machines as well.

Use Case

Implementing has_primary_ip can avoid the need of having different setups for dealing with devices and virtual machines. A current use case is importing NetBox object into a third-party system for managing firewall rules. With devices I can easily import only the devices with a primary IP address using the has_primary_ip filter, while with virtual machines I have to make the IP lookup on my own and thus creating two different workflows for the same task.

Database Changes

None

External Dependencies

None

Originally created by @rodvand on GitHub (Oct 5, 2020). Originally assigned to: @jeremystretch on GitHub. ### Environment * Python version: 3.7.5 * NetBox version: 2.9.3 ### Proposed Functionality Add the `has_primary_ip` filter which is currently available for devices to virtual machines as well. ### Use Case Implementing has_primary_ip can avoid the need of having different setups for dealing with devices and virtual machines. A current use case is importing NetBox object into a third-party system for managing firewall rules. With devices I can easily import only the devices with a primary IP address using the `has_primary_ip` filter, while with virtual machines I have to make the IP lookup on my own and thus creating two different workflows for the same task. ### Database Changes None ### External Dependencies None
adam added the type: bugstatus: accepted labels 2025-12-29 18:33:35 +01:00
adam closed this issue 2025-12-29 18:33:35 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 9, 2020):

I'm reclassifying this as a bug since it's reasonable to expect that the has_primary_ip filter would be available for both devices and virtual machines given that they both have a primary_ip attribute.

@jeremystretch commented on GitHub (Oct 9, 2020): I'm reclassifying this as a bug since it's reasonable to expect that the `has_primary_ip` filter would be available for both devices and virtual machines given that they both have a `primary_ip` attribute.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4165