get all prefixes by vlan id #3360

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

Originally created by @Dimaqa on GitHub (Feb 20, 2020).

Environment

  • Python version: 3.6.9
  • NetBox version: 2.7.6

So if we have 2 vlans with the same id and 2 prefixes in those vlans, api get all prefixes by vlan_id
will get only 1 result

Steps to Reproduce

  1. Create 2 vlans with same id
  2. Create 2 prefixes and place them in different vlans
  3. get /api/ipam/prefixes/?vlan_id={created id}

Expected Behavior

Should get all prefixes

Observed Behavior

Got only one result

Originally created by @Dimaqa on GitHub (Feb 20, 2020). ### Environment * Python version: 3.6.9 * NetBox version: 2.7.6 So if we have 2 vlans with the same id and 2 prefixes in those vlans, api get all prefixes by vlan_id will get only 1 result ### Steps to Reproduce 1. Create 2 vlans with same id 2. Create 2 prefixes and place them in different vlans 3. get /api/ipam/prefixes/?vlan_id={created id} ### Expected Behavior Should get all prefixes ### Observed Behavior Got only one result
adam closed this issue 2025-12-29 18:28:17 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 20, 2020):

vlan_id references the database ID of a particular VLAN object (which is assigned by NetBox). You want vlan_vid, which references the 802.1Q identifier (1-4094) assigned to the VLAN.

@jeremystretch commented on GitHub (Feb 20, 2020): `vlan_id` references the database ID of a particular VLAN object (which is assigned by NetBox). You want `vlan_vid`, which references the 802.1Q identifier (1-4094) assigned to the VLAN.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3360