From 4f6f032ca2c1949cd584af53f5321df97b4ec60b Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 15 Jul 2016 21:12:35 -0700 Subject: [PATCH 1/2] Update the valid urls, to expose the new api connection listing endpoint. Naming convention updated for both interface connections to match the rest. --- netbox/dcim/api/urls.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netbox/dcim/api/urls.py b/netbox/dcim/api/urls.py index 724e244a2..a22a661aa 100644 --- a/netbox/dcim/api/urls.py +++ b/netbox/dcim/api/urls.py @@ -61,7 +61,8 @@ urlpatterns = [ url(r'^interfaces/(?P\d+)/$', InterfaceDetailView.as_view(), name='interface_detail'), url(r'^interfaces/(?P\d+)/graphs/$', GraphListView.as_view(), {'type': GRAPH_TYPE_INTERFACE}, name='interface_graphs'), - url(r'^interface-connections/(?P\d+)/$', InterfaceConnectionView.as_view(), name='interfaceconnection'), + url(r'^interface-connections/$', InterfaceConnectionListView.as_view(), name='interfaceconnection_list'), + url(r'^interface-connections/(?P\d+)/$', InterfaceConnectionView.as_view(), name='interfaceconnection_detail'), # Miscellaneous url(r'^related-connections/$', RelatedConnectionsView.as_view(), name='related_connections'), From c65b9fcb0b5ddd1f3f843f2573bf5b54a0bdcc65 Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 15 Jul 2016 21:13:15 -0700 Subject: [PATCH 2/2] Add an api endpoint for listing all connections --- netbox/dcim/api/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/netbox/dcim/api/views.py b/netbox/dcim/api/views.py index d573cddde..27b908d56 100644 --- a/netbox/dcim/api/views.py +++ b/netbox/dcim/api/views.py @@ -326,6 +326,14 @@ class InterfaceConnectionView(generics.RetrieveUpdateDestroyAPIView): queryset = InterfaceConnection.objects.all() +class InterfaceConnectionListView(generics.ListAPIView): + """ + Retrieve a list of all interface connections + """ + serializer_class = serializers.InterfaceConnectionSerializer + queryset = InterfaceConnection.objects.all() + + # # Device bays #