2017-08-08 16:33:34 -04:00
|
|
|
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
|
2020-02-05 16:12:48 -05:00
|
|
|
router.register('cluster-types', views.ClusterTypeViewSet)
|
|
|
|
router.register('cluster-groups', views.ClusterGroupViewSet)
|
|
|
|
router.register('clusters', views.ClusterViewSet)
|
2017-08-08 16:33:34 -04:00
|
|
|
|
|
|
|
# VirtualMachines
|
2020-02-05 16:12:48 -05:00
|
|
|
router.register('virtual-machines', views.VirtualMachineViewSet)
|
|
|
|
router.register('interfaces', views.InterfaceViewSet)
|
2017-08-08 16:33:34 -04:00
|
|
|
|
|
|
|
app_name = 'virtualization-api'
|
|
|
|
urlpatterns = router.urls
|