Просмотр исходного кода

Add /trace API endpoints for CircuitTermination and PowerFeed

Jeremy Stretch 5 лет назад
Родитель
Сommit
0e41bc48b7
3 измененных файлов с 7 добавлено и 3 удалено
  1. 4 1
      docs/release-notes/version-2.10.md
  2. 2 1
      netbox/circuits/api/views.py
  3. 1 1
      netbox/dcim/api/views.py

+ 4 - 1
docs/release-notes/version-2.10.md

@@ -62,6 +62,7 @@ All end-to-end cable paths are now cached using the new CablePath model. This al
 
 * Added support for `PUT`, `PATCH`, and `DELETE` operations on list endpoints (bulk update and delete)
 * circuits.CircuitTermination:
+  * Added the `/trace/` endpoint
   * Replaced `connection_status` with `connected_endpoint_reachable` (boolean)
   * Added `cable_peer` and `cable_peer_type`
 * dcim.Cable: Added `custom_fields`
@@ -81,7 +82,9 @@ All end-to-end cable paths are now cached using the new CablePath model. This al
   * Added `cable_peer` and `cable_peer_type`
   * Removed `connection_status` from nested serializer
 * dcim.InventoryItem: The `_depth` field has been added to reflect MPTT positioning
-* dcim.PowerFeed: Add fields `connected_endpoint`, `connected_endpoint_type`, `connected_endpoint_reachable`, `cable_peer`, and `cable_peer_type`
+* dcim.PowerFeed:
+  * Added the `/trace/` endpoint
+  * Added fields `connected_endpoint`, `connected_endpoint_type`, `connected_endpoint_reachable`, `cable_peer`, and `cable_peer_type`
 * dcim.PowerOutlet:
   * Replaced `connection_status` with `connected_endpoint_reachable` (boolean)
   * Added `cable_peer` and `cable_peer_type`

+ 2 - 1
netbox/circuits/api/views.py

@@ -3,6 +3,7 @@ from rest_framework.routers import APIRootView
 
 from circuits import filters
 from circuits.models import Provider, CircuitTermination, CircuitType, Circuit
+from dcim.api.views import PathEndpointMixin
 from extras.api.views import CustomFieldModelViewSet
 from utilities.api import ModelViewSet
 from . import serializers
@@ -57,7 +58,7 @@ class CircuitViewSet(CustomFieldModelViewSet):
 # Circuit Terminations
 #
 
-class CircuitTerminationViewSet(ModelViewSet):
+class CircuitTerminationViewSet(PathEndpointMixin, ModelViewSet):
     queryset = CircuitTermination.objects.prefetch_related(
         'circuit', 'site', '_path__destination', 'cable'
     )

+ 1 - 1
netbox/dcim/api/views.py

@@ -614,7 +614,7 @@ class PowerPanelViewSet(ModelViewSet):
 # Power feeds
 #
 
-class PowerFeedViewSet(CustomFieldModelViewSet):
+class PowerFeedViewSet(PathEndpointMixin, CustomFieldModelViewSet):
     queryset = PowerFeed.objects.prefetch_related(
         'power_panel', 'rack', '_path__destination', 'cable', '_cable_peer', 'tags'
     )