Cannot filter virtual machine interfaces #1276

Closed
opened 2025-12-29 16:31:01 +01:00 by adam · 4 comments
Owner

Originally created by @hamishforbes on GitHub (Oct 4, 2017).

Issue type

[ ] Feature request
[x] Bug report
[ ] Documentation

Environment

  • Python version: 2.7.5
  • NetBox version: 2.2-beta2

Description

Not sure if this counts as a bug or a feature request, but as far as I can tell there's no way to filter the /virtualisation/interfaces/ API endpoint?
The only way to determine which interfaces a VM has is to get all the interfaces and iterate over them clientside.

Originally created by @hamishforbes on GitHub (Oct 4, 2017). <!-- Before opening a new issue, please search through the existing issues to see if your topic has already been addressed. Note that you may need to remove the "is:open" filter from the search bar to include closed issues. Check the appropriate type for your issue below by placing an x between the brackets. If none of the below apply, please raise your issue for discussion on our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please note that issues which do not fall under any of the below categories will be closed. ---> ### Issue type [ ] Feature request <!-- Requesting the implementation of a new feature --> [x] Bug report <!-- Reporting unexpected or erroneous behavior --> [ ] Documentation <!-- Proposing a modification to the documentation --> <!-- Please describe the environment in which you are running NetBox. (Be sure to verify that you are running the latest stable release of NetBox before submitting a bug report.) --> ### Environment * Python version: 2.7.5<!-- Example: 3.5.4 --> * NetBox version: 2.2-beta2 <!-- Example: 2.1.3 --> <!-- BUG REPORTS must include: * A list of the steps needed to reproduce the bug * A description of the expected behavior * Any relevant error messages (screenshots may also help) FEATURE REQUESTS must include: * A detailed description of the proposed functionality * A use case for the new feature * A rough description of any necessary changes to the database schema * Any relevant third-party libraries which would be needed --> ### Description Not sure if this counts as a bug or a feature request, but as far as I can tell there's no way to filter the `/virtualisation/interfaces/` API endpoint? The only way to determine which interfaces a VM has is to get all the interfaces and iterate over them clientside.
adam added the type: bug label 2025-12-29 16:31:01 +01:00
adam closed this issue 2025-12-29 16:31:01 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 6, 2017):

We should probably just ditch the /api/virtualization/interfaces/ endpoint entirely. It's redundant to the DCIM-based endpoint.

@jeremystretch commented on GitHub (Oct 6, 2017): We should probably just ditch the `/api/virtualization/interfaces/` endpoint entirely. It's redundant to the DCIM-based endpoint.
Author
Owner

@hamishforbes commented on GitHub (Oct 6, 2017):

That seems reasonable, although it begs the question: should the
/virtualization/ endpoint exist at all? Maybe virtual-machines should
just be part of dcim?

On 6 Oct 2017 20:59, "Jeremy Stretch" notifications@github.com wrote:

We should probably just ditch the /api/virtualization/interfaces/ endpoint
entirely. It's redundant to the DCIM-based endpoint.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/digitalocean/netbox/issues/1557#issuecomment-334855409,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABOQV-2EDiGqpA6uaJ8KE09JOSs4n9TAks5spoalgaJpZM4PtvyY
.

@hamishforbes commented on GitHub (Oct 6, 2017): That seems reasonable, although it begs the question: should the `/virtualization/` endpoint exist at all? Maybe virtual-machines should just be part of dcim? On 6 Oct 2017 20:59, "Jeremy Stretch" <notifications@github.com> wrote: We should probably just ditch the /api/virtualization/interfaces/ endpoint entirely. It's redundant to the DCIM-based endpoint. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/digitalocean/netbox/issues/1557#issuecomment-334855409>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABOQV-2EDiGqpA6uaJ8KE09JOSs4n9TAks5spoalgaJpZM4PtvyY> .
Author
Owner

@jeremystretch commented on GitHub (Oct 7, 2017):

VirtualMachines and Clusters are their own discrete models with dedicated tables in the database, so they need their own endpoints. This is in contrast to the Interface model, which is actually shared by Devices and VirtualMachines.

@jeremystretch commented on GitHub (Oct 7, 2017): VirtualMachines and Clusters are their own discrete models with dedicated tables in the database, so they need their own endpoints. This is in contrast to the Interface model, which is actually shared by Devices and VirtualMachines.
Author
Owner

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

After pondering this a bit more, it's cleaner to maintain a separate endpoint for VM interfaces. In addition to being more efficient (since the DCIM endpoint only pulls in devices and the virtualization endpoint only pulls in VMs), there's enough difference between the two interface representations to justify separate filters.

@jeremystretch commented on GitHub (Oct 9, 2017): After pondering this a bit more, it's cleaner to maintain a separate endpoint for VM interfaces. In addition to being more efficient (since the DCIM endpoint only pulls in devices and the virtualization endpoint only pulls in VMs), there's enough difference between the two interface representations to justify separate filters.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1276