from django.conf.urls import url, include from rest_framework import routers from .views.station_test_views import * from .views.rtsm_views import * from .views.logs_view import * from rest_framework.documentation import include_docs_urls log_router = routers.DefaultRouter() log_router.register(r'action_log', ActionLogViewSet) station_test_router = routers.DefaultRouter() #Station test station_test_router.register(r'element_error', ElementErrorViewSet) station_test_router.register(r'element', ElementViewSet) station_test_router.register(r'component_error', ComponentErrorViewSet) station_test_router.register(r'component', ComponentViewSet) station_test_router.register(r'station', StationViewSet) station_test_router.register(r'', StationTestViewSet) rtsm_router = routers.DefaultRouter() #RTSM rtsm_router.register(r'summary', RTSMObservationSummaryViewSet) rtsm_router.register(r'errors_detailed', RTSMErrorsDetailedViewSet) rtsm_router.register(r'errors', RTSMErrorsViewSet) rtsm_router.register(r'spectra', RTSMSpectrumViewSet) rtsm_router.register(r'', RTSMObservationViewSet) urlpatterns = [ url(r'^api/stationtests/', include(station_test_router.urls)), url(r'^api/rtsm/', include(rtsm_router.urls)), url(r'^api/api-auth', include('rest_framework.urls', namespace='rest_framework')), url(r'^api/stationtests/raw/insert', insert_raw_station_test), url(r'^api/rtsm/raw/insert', insert_raw_rtsm_test), url(r'^api/log/', include(log_router.urls)), url(r'^api/docs', include_docs_urls(title='Monitoring DB API')) ]