Parcourir la source

Removed legacy LLDP neighbors API endpoint

Jeremy Stretch il y a 7 ans
Parent
commit
e85cc0d856
1 fichiers modifiés avec 0 ajouts et 23 suppressions
  1. 0 23
      netbox/dcim/api/views.py

+ 0 - 23
netbox/dcim/api/views.py

@@ -286,29 +286,6 @@ class DeviceViewSet(WritableSerializerMixin, CustomFieldModelViewSet):
         return Response(response)
 
 
-    @detail_route(url_path='lldp-neighbors')
-    def lldp_neighbors(self, request, pk):
-        """
-        Retrieve live LLDP neighbors of a device
-        """
-        device = get_object_or_404(Device, pk=pk)
-        if not device.primary_ip:
-            raise ServiceUnavailable("No IP configured for this device.")
-
-        RPC = device.get_rpc_client()
-        if not RPC:
-            raise ServiceUnavailable("No RPC client available for this platform ({}).".format(device.platform))
-
-        # Connect to device and retrieve inventory info
-        try:
-            with RPC(device, username=settings.NETBOX_USERNAME, password=settings.NETBOX_PASSWORD) as rpc_client:
-                lldp_neighbors = rpc_client.get_lldp_neighbors()
-        except:
-            raise ServiceUnavailable("Error connecting to the remote device.")
-
-        return Response(lldp_neighbors)
-
-
 #
 # Device components
 #