nautobot
nautobot copied to clipboard
Add API calls for VLAN groups available-vlans functionality
Environment
- Python version: 3.8.8
- Nautobot version: 1.2.5
Proposed Functionality
The VLAN Groups page show the available VLANs within a specific VLAN group. Clicking on the "# VLANs available" link brings the user to a new page to reserve the next available VLAN from that range. This functionality should be exposed via API to allow for automated VLAN assignment.
This functionality has been implemented in Netbox #2658 with an additional enhancement to add scoping for min/max VLAN IDs in #8168.
Use Case
As a Nautobot user, I would like to programmatically assign VLANs to new tenant buildouts using a single API call so that I can avoid race conditions querying then reserving VLANs when multiple workflows are reserving VLANs at the same time.
Database Changes
New method is required in VLANGroup model to get available VLANs. To implement the min/max VLAN ID scoping two new fields are required in the VLANGroup model, min_vid and max_vid.
External Dependencies
None
Thanks for the submission. The NetBox feature solves the problem, however we would likely do it in a slightly different way by implementing the nested endpoint as a viewset method (e.g. VLANGroupViewSet.available_vlans
) so that we can reduce code duplication.
This would be a great feature to have, a min/max VLAN ID, so we can programmatically get the next available VLAN ID
Is this on the roadmap for any upcoming releases? Would love to see this feature, I'd happily pay a bounty if that would help?
I would also love this feature to be able to automate vlan assignments!
The company I work for could use this feature very much. It is one of the points of debate about choosing Nautobot VS Netbox. Being able to limit the available vlans in a group without actually reserving all vlans would be useful.
In our case we have several vlan groups within a layer 2 domain. All groups together on a "site" form all vlans in the l2 domain (if that makes sense). (in our case that is, a site equals a routing edge for us.)