diff --git a/netbox/circuits/api/urls.py b/netbox/circuits/api/urls.py index d53f13d83..4957a7e73 100644 --- a/netbox/circuits/api/urls.py +++ b/netbox/circuits/api/urls.py @@ -3,7 +3,16 @@ from rest_framework import routers from . import views +class CircuitsRootView(routers.APIRootView): + """ + Circuits API root view + """ + def get_view_name(self): + return 'Circuits' + + router = routers.DefaultRouter() +router.APIRootView = CircuitsRootView # Providers router.register(r'providers', views.ProviderViewSet) diff --git a/netbox/dcim/api/urls.py b/netbox/dcim/api/urls.py index 9f7aa3717..8556e4141 100644 --- a/netbox/dcim/api/urls.py +++ b/netbox/dcim/api/urls.py @@ -3,7 +3,16 @@ from rest_framework import routers from . import views +class DCIMRootView(routers.APIRootView): + """ + DCIM API root view + """ + def get_view_name(self): + return 'DCIM' + + router = routers.DefaultRouter() +router.APIRootView = DCIMRootView # Sites router.register(r'regions', views.RegionViewSet) diff --git a/netbox/extras/api/urls.py b/netbox/extras/api/urls.py index ec1fa978b..1623dcdeb 100644 --- a/netbox/extras/api/urls.py +++ b/netbox/extras/api/urls.py @@ -3,7 +3,16 @@ from rest_framework import routers from . import views +class ExtrasRootView(routers.APIRootView): + """ + Extras API root view + """ + def get_view_name(self): + return 'Extras' + + router = routers.DefaultRouter() +router.APIRootView = ExtrasRootView # Graphs router.register(r'graphs', views.GraphViewSet) diff --git a/netbox/ipam/api/urls.py b/netbox/ipam/api/urls.py index c72d501dd..cc37b651a 100644 --- a/netbox/ipam/api/urls.py +++ b/netbox/ipam/api/urls.py @@ -3,7 +3,16 @@ from rest_framework import routers from . import views +class IPAMRootView(routers.APIRootView): + """ + IPAM API root view + """ + def get_view_name(self): + return 'IPAM' + + router = routers.DefaultRouter() +router.APIRootView = IPAMRootView # VRFs router.register(r'vrfs', views.VRFViewSet) diff --git a/netbox/secrets/api/urls.py b/netbox/secrets/api/urls.py index da84afe82..18c7ec4c1 100644 --- a/netbox/secrets/api/urls.py +++ b/netbox/secrets/api/urls.py @@ -3,7 +3,16 @@ from rest_framework import routers from . import views +class SecretsRootView(routers.APIRootView): + """ + Secrets API root view + """ + def get_view_name(self): + return 'Secrets' + + router = routers.DefaultRouter() +router.APIRootView = SecretsRootView # Secrets router.register(r'secret-roles', views.SecretRoleViewSet) diff --git a/netbox/tenancy/api/urls.py b/netbox/tenancy/api/urls.py index 5fb0be708..bedabf67d 100644 --- a/netbox/tenancy/api/urls.py +++ b/netbox/tenancy/api/urls.py @@ -3,7 +3,16 @@ from rest_framework import routers from . import views +class TenancyRootView(routers.APIRootView): + """ + Tenancy API root view + """ + def get_view_name(self): + return 'Tenancy' + + router = routers.DefaultRouter() +router.APIRootView = TenancyRootView # Tenants router.register(r'tenant-groups', views.TenantGroupViewSet)