1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Commit Graph

30 Commits

Author SHA1 Message Date
7abb2b2ab5 Closes #15131: Dynamic queryset annotations for REST API endpoints (#15152)
* Introduce RelatedObjectCountField

* Introduce get_annotations_for_serializer() and enable dynamic annotations

* Add RelatedObjectCountFields to serializers; remove static annotations from querysets

* Remove annotations cleanup logic from BriefModeMixin

* Annotate type for RelatedObjectCountField

* Remove redundant field on TagSerializer

* Add missing reverse relationship for power feeds to rack

* Refactor RelatedObjectCountField to take a single relationship name
2024-02-15 14:49:27 -05:00
b3f25a400b Closes #15087: Support for specifying a subset of API serializer fields (#15122)
* Enable dynamic field inclusion for REST API serializers

* Recurse through nested serializer when resolving prefetches

* Remove obsolete calls to prefetch_related() for API views

* Remove support for brief_prefetch_fields viewset attribute

* Rename query parameter

* Fixes #15133: Fix FHRP group representation on assignments endpoint under brief mode (#15134)

* Fixes #15133: Fix FHRP group representation on assignments endpoint under brief mode

* Update API test

* Restore get_queryset() on BriefModeMixin, minus prefetch logic

* get_prefetches_for_serializer() should reference serializer field source if set
2024-02-14 09:28:37 -05:00
d2fea4edc4 Closes #14311: Move L2VPN models from ipam to vpn (#14358)
* Move L2VPN and L2VPNTermination models from ipam to vpn

* Move L2VPN resources from ipam to vpn

* Extend migration to update content types

* Misc cleanup
2023-11-28 13:45:00 -05:00
55385dd0db 12278 add ipaddressfield serializer for OpenAPI spectacular typing (#12285)
* #12278 add serializer for ipaddressfield to remove spectacular warnings

* #12278 add ipaddressfieldserializer to nested serializers

* #12278 fix to_internal_value to_representation in serializer

* #12278 to_internal_value is called before validation! need to raise validation error if incorrect format

* #12278 to_internal_value needs to return value doh

* #12278 move IPAddressField to field_serializers

* #12278 remove old import

* 12278 remove validator
2023-04-21 12:41:03 -04:00
ecd0c56554 Closes #9608: Move from drf-yasg to spectacular
Co-authored-by: arthanson <worldnomad@gmail.com>
Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
2023-03-30 14:32:59 -04:00
7994073687 Closes #8550: Implement ASN ranges (#11835)
* Move ASN to a separate module

* Move ASNField from dcim to ipam

* Introduce ASNRange model

* Add relationship from ASN to ASNRange

* Add an available-asns API endpoint

* Add RIR assignment for ASNRange

* Add standard tests

* Move child ASNs to a tabbed view

* Remove FK on ASN to ASNRange

* Add tests for provisioning available ASNs

* Add docs for ASNRange
2023-02-27 16:36:05 -05:00
3eb6b6c07f Clean up core API imports 2022-07-13 16:18:55 -04:00
aa856e75e8 Change Virtual Circuits to L2VPN
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-07-06 08:02:44 -05:00
6e983d1542 Fix up some PEP errors 2022-06-29 16:14:30 -05:00
3be9f6c4f3 #8157 - Final work on L2VPN model 2022-06-29 16:01:20 -05:00
03f1584d3a L2VPN Clean Tree 2022-06-27 23:24:50 -05:00
97e7ef9a3f Introduce ServiceTemplate 2022-01-12 16:42:28 -05:00
3f0a98acbd Add nested FHRPGroupAssignment serializer; add missing API tests 2021-11-04 11:15:34 -04:00
67c73768c1 Add count_fhrp_groups to interface serializers 2021-11-04 09:58:33 -04:00
db2d71ed9e Merge branch 'feature' into 6732-asn-model 2021-11-03 08:37:11 -05:00
bb4f3e1789 Initial work on #6235 2021-11-01 16:56:30 -04:00
a01068949c Initial work on #6732 2021-10-24 23:42:47 -05:00
11a14927c9 Initial work on IP ranges 2021-07-16 13:35:52 -04:00
2d44bade4b Merge branch 'develop' into feature 2021-06-02 20:35:38 -04:00
75faf7d30e Closes #6501: Expose prefix depth and children on REST API serializer 2021-05-28 08:56:55 -04:00
5856275347 Closes #5991: Remove display_name attribute from serializers 2021-05-04 15:56:36 -04:00
fb48c1f6dd Add 'display' field to all REST API serializers 2021-03-16 10:06:25 -04:00
c0c5f52ed9 Reorganize REST API components under netbox app 2020-10-13 15:57:21 -04:00
dfb5a06d9d Introduce the RouteTarget model 2020-09-24 11:25:52 -04:00
f97d8963f2 Initial work on #2179: Allow a service to have multiple ports 2020-09-21 13:21:41 -04:00
acd5f21866 Fixes #4992: Add display_name to nested VRF serializer 2020-08-13 09:56:03 -04:00
9c1dd159de Address/prefix/aggregate family is an integer, not a string. Fixes #4803 2020-07-13 14:50:58 -04:00
e616aad911 Fixes #4725: Fix "brief" rendering of various REST API endpoints 2020-06-05 15:49:06 -04:00
a46b43bff6 Added child counts to API serializers (WIP) 2019-04-12 17:07:56 -04:00
75f0d8ee90 Closes #2578: Reorganized nested serializers 2018-11-12 11:36:44 -05:00