Allow filtering interfaces by assigned VLAN #2003

Closed
opened 2025-12-29 17:21:22 +01:00 by adam · 4 comments
Owner

Originally created by @reinierk on GitHub (Sep 14, 2018).

Add API endpoint /ipam/vlans/{id}/members/

Environment

  • Python version: 3.6.6
  • NetBox version: v2.4.4

Proposed Functionality

It seems that the vlan member list endpoint is missing from the API. There is a corresponding URL in the website...

Use Case

Be able to programmatically access the vlan membership page of NetBox.

Database Changes

Database Changes: None

External Dependencies

External Libraries: None

B.T.W: Many thanks for this great piece of software!

Kind Regrards,
Reinier Kleipool

Originally created by @reinierk on GitHub (Sep 14, 2018). Add API endpoint /ipam/vlans/{id}/members/ ### Environment * Python version: 3.6.6 * NetBox version: v2.4.4 ### Proposed Functionality It seems that the vlan member list endpoint is missing from the API. There is a corresponding URL in the website... ### Use Case Be able to programmatically access the vlan membership page of NetBox. ### Database Changes Database Changes: None ### External Dependencies External Libraries: None B.T.W: Many thanks for this great piece of software! Kind Regrards, Reinier Kleipool
adam added the status: acceptedtype: feature labels 2025-12-29 17:21:22 +01:00
adam closed this issue 2025-12-29 17:21:22 +01:00
Author
Owner

@lampwins commented on GitHub (Sep 15, 2018):

Thank you for your interest in NetBox. We require that all issues be submitted using one of the templates provided here. This is to ensure that only valid issues are reported and that each issue includes all the information necessary for a developer to act on it. Please update your issue so that it matches the appropriate template (this may require rewriting your issue entirely). This issue will be closed in one week if it has not been updated. Thanks!

@lampwins commented on GitHub (Sep 15, 2018): Thank you for your interest in NetBox. We require that all issues be submitted using one of the templates provided [here](https://github.com/digitalocean/netbox/issues/new/choose). This is to ensure that only valid issues are reported and that each issue includes all the information necessary for a developer to act on it. Please update your issue so that it matches the appropriate template (this may require rewriting your issue entirely). This issue will be closed in one week if it has not been updated. Thanks!
Author
Owner

@DanSheps commented on GitHub (Sep 21, 2018):

I believe he is using the correct template now.

I would also like a /members (more specifically a /devices however /members would work however as the devices can be obtained from that).

If I have time, I will see if I can do up the PR myself for this.

@DanSheps commented on GitHub (Sep 21, 2018): I believe he is using the correct template now. I would also like a /members (more specifically a /devices however /members would work however as the devices can be obtained from that). If I have time, I will see if I can do up the PR myself for this.
Author
Owner

@jeremystretch commented on GitHub (Sep 27, 2018):

The REST API does not directly map to the web UI for obvious reasons. A members extension to the VLAN endpoint would deviate from the structure. Instead, we would need to add a filter for the interfaces endpoint which allows for filtering by assigned VLAN. For reference, the queryset looks like this:

Interface.objects.filter(Q(untagged_vlan_id=vlan_pk) | Q(tagged_vlans=vlan_pk))
@jeremystretch commented on GitHub (Sep 27, 2018): The REST API does not directly map to the web UI for obvious reasons. A `members` extension to the VLAN endpoint would deviate from the structure. Instead, we would need to add a filter for the interfaces endpoint which allows for filtering by assigned VLAN. For reference, the queryset looks like this: ``` Interface.objects.filter(Q(untagged_vlan_id=vlan_pk) | Q(tagged_vlans=vlan_pk)) ```
Author
Owner

@DanSheps commented on GitHub (Oct 15, 2018):

@jeremystretch I am working on a pull for this today, expect it to be out shortly.

I am actually adding a filter for vid as well, so you can filter by vlan_pk or vid, I am not exposing it to the GUI at this time, but I imagine it would be trivial to do if so desired.

@DanSheps commented on GitHub (Oct 15, 2018): @jeremystretch I am working on a pull for this today, expect it to be out shortly. I am actually adding a filter for vid as well, so you can filter by vlan_pk or vid, I am not exposing it to the GUI at this time, but I imagine it would be trivial to do if so desired.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2003