mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
26 lines
547 B
Python
26 lines
547 B
Python
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
|
|
|
|
# Field choices
|
|
router.register(r'_choices', views.TenancyFieldChoicesViewSet, basename='field-choice')
|
|
|
|
# Tenants
|
|
router.register(r'tenant-groups', views.TenantGroupViewSet)
|
|
router.register(r'tenants', views.TenantViewSet)
|
|
|
|
app_name = 'tenancy-api'
|
|
urlpatterns = router.urls
|