mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Closes #4997: Introduce OrderedDefaultRouter; move root API views to views.py
This commit is contained in:
@ -1,18 +1,9 @@
|
||||
from rest_framework import routers
|
||||
|
||||
from utilities.api import OrderedDefaultRouter
|
||||
from . import views
|
||||
|
||||
|
||||
class VirtualizationRootView(routers.APIRootView):
|
||||
"""
|
||||
Virtualization API root view
|
||||
"""
|
||||
def get_view_name(self):
|
||||
return 'Virtualization'
|
||||
|
||||
|
||||
router = routers.DefaultRouter()
|
||||
router.APIRootView = VirtualizationRootView
|
||||
router = OrderedDefaultRouter()
|
||||
router.APIRootView = views.VirtualizationRootView
|
||||
|
||||
# Clusters
|
||||
router.register('cluster-types', views.ClusterTypeViewSet)
|
||||
|
Reference in New Issue
Block a user