mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
28 lines
677 B
Python
28 lines
677 B
Python
from rest_framework import routers
|
|
|
|
from . import views
|
|
|
|
|
|
class VirtualizationRootView(routers.APIRootView):
|
|
"""
|
|
Virtualization API root view
|
|
"""
|
|
def get_view_name(self):
|
|
return 'Virtualization'
|
|
|
|
|
|
router = routers.DefaultRouter()
|
|
router.APIRootView = VirtualizationRootView
|
|
|
|
# Clusters
|
|
router.register('cluster-types', views.ClusterTypeViewSet)
|
|
router.register('cluster-groups', views.ClusterGroupViewSet)
|
|
router.register('clusters', views.ClusterViewSet)
|
|
|
|
# VirtualMachines
|
|
router.register('virtual-machines', views.VirtualMachineViewSet)
|
|
router.register('interfaces', views.InterfaceViewSet)
|
|
|
|
app_name = 'virtualization-api'
|
|
urlpatterns = router.urls
|