diff --git a/netbox/circuits/api/urls.py b/netbox/circuits/api/urls.py index d53f13d836a..4957a7e739d 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 9f7aa37170b..8556e414154 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 ec1fa978bb7..1623dcdeb90 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 c72d501dd5f..cc37b651a1c 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 da84afe82d2..18c7ec4c155 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 5fb0be70837..bedabf67dc7 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)