Commit Graph

18 Commits

Author SHA1 Message Date
Arthur Hanson
822fa64a83 17306 fix vlan group utilization 2024-08-29 15:56:06 -04:00
Arthur Hanson
4821679731 9627 use ArrayField on VLANGroup for allowed VLANs (#16710)
* 9627 initial commit

* 9627 numeric range field

* 9627 numeric range field

* 9627 numeric range field

* 9627 numeric range field

* 9627 add stuff for utilization calc

* 9627 update views

* 9627 fixes

* 9627 available_vlans

* 9627 available_vlans

* 9627 fixes

* 9627 bulk import / edit

* 9627 test fixes

* 9627 test fixes

* 9627 update validation

* 9627 fix tests

* 9627 fix tests

* 9627 fix tests

* 9627 fix tests

* 9627 fix tests

* 9627 fix tests

* 9627 review changes

* 9627 temp vlan_id filter

* Clean up labels

* Remove annotate_vlan_ranges() from VLANGroupQuerySet

* Misc cleanup

* Implement contains_vid filter

* Serialize VID ranges as integer lists in REST API

* Remove default value from vlan_id_ranges

* 9627 fix typo in test

* Require vlan_id_ranges & set default value

* Fix logic for upper range boundaries

* Add field to VLANGroup model documentation

* Rename vlan_id_ranges to vid_ranges

* Fix computation of available VLAN IDs

* Clean up migration

* Add tests for range utility functions

* Clean up add_available_vlans()

* Misc cleanup, add test for VID validation

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-07-16 10:47:18 -04:00
Jeremy Stretch
d636da5f32 Move count_related() & dict_to_filter_params() to utilities.query 2024-03-22 08:59:52 -04:00
Daniel Sheppard
21d32228c4 Closes #14538 - Add available_at_site filter (#14541)
* Closes #14538 - Add available_at_site filter

* Add tests

* Fix tests
2023-12-21 15:40:57 -05:00
Jeremy Stretch
1d404cc1d3 Closes #11738: Annotate utilization on VLAN groups (#13108)
* Update serializers.py

* Update vlans.py

* Update vlans.py

* Update vlangroup.html

* Update vlans.py

* Update vlans.py

* Update serializers.py

* adds db annotation to calculate utilization

* optimize queries

* merge fix

* adds round function for utilization to limit decimal

* fixed object view annotation

* consolidated queryset for utilization

* lint fixes

* Renamed manager method to annotate_utilization() for consistency with other managers

---------

Co-authored-by: Abhimanyu Saharan <desk.abhimanyu@gmail.com>
2023-07-06 14:51:28 -04:00
Jeremy Stretch
2f3b6d6c70 Fixes #13047: Add annotate_asn_count() to ASNRange manager 2023-07-06 08:45:02 -04:00
jeremystretch
3b6d9c7135 Filter VLANs and VLANGroups by site or cluster site for VM 2022-09-26 10:08:54 -04:00
Arthur
42b8cd284d 10435 check if vm.cluster in qs 2022-09-22 10:34:37 -07:00
jeremystretch
094b11857f Initial work on #6087 2021-05-26 16:06:03 -04:00
jeremystretch
c51c7d3f5a Fixes #6369: Fix interface assignment for VLANs in non-scoped groups 2021-05-06 14:36:23 -04:00
Jeremy Stretch
1196d5945c Fix VM VLAN filtering 2021-03-30 21:46:56 -04:00
Jeremy Stretch
4f2ff6a791 Add 'available_on' VLAN filters for devices & VMs 2021-03-30 21:32:48 -04:00
Jeremy Stretch
7d2484a0db Replace annotate_depth() with annotate_tree() 2020-08-05 15:55:47 -04:00
Jeremy Stretch
55cc22f41a Implement RestrictedQuerySet as a manager 2020-05-29 16:27:36 -04:00
chambersh1129
de71669d93 Replace all instances of .extra() in QuerySets with annotations, including references in docstrings 2019-10-09 20:11:02 -04:00
Jeremy Stretch
e585ac4815 Closes #3094: Remove NullsFirstQuerySet 2019-04-19 20:59:07 -04:00
Jeremy Stretch
68a5dcd47e Removed Python 2 string compatibility 2018-08-14 11:58:42 -04:00
Jeremy Stretch
30e9195a20 Moved querysets to separate files; tweaked interface ordering logic (#1523) 2017-10-10 17:23:41 -04:00