Blame view

src/core/pyros_django/api/urls.py 1.54 KB
98621b46   Alexis Koralewski   add DRF, pyros ap...
1
2
3
from django.urls import path, include
from . import views
from rest_framework.authtoken.views import obtain_auth_token
4b904014   Alexis Koralewski   Add view to get s...
4
from rest_framework import routers, renderers
3c68e37e   Alexis Koralewski   Add API docs to w...
5
6
from django.views.generic import TemplateView
from rest_framework.schemas import get_schema_view 
98621b46   Alexis Koralewski   add DRF, pyros ap...
7
8
9
10

router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'sequences', views.SequenceViewSet)
c2589779   Alexis Koralewski   Adding API views ...
11
12
13
router.register(r'albums', views.AlbumViewSet)
router.register(r'plans', views.PlanViewSet)
router.register(r'full_sequences', views.FullSequenceViewSet)
995a2ae6   Alexis Koralewski   adding scientific...
14
router.register(r'scientific_programs', views.ScientificProgramViewSet)
33c8da07   Alexis Koralewski   Adding SP_Period ...
15
router.register(r'sp_period', views.SPPeriodViewSet)
0d6aa42f   Alexis Koralewski   Add vuejs in agen...
16
router.register(r'agent_survey', views.AgentSurveyViewSet)
e49ef271   Alexis Koralewski   Add vue to render...
17
router.register(r'agent_cmd', views.AgentCmdViewSet)
2fa661e0   Alexis Koralewski   Add API docs & AP...
18
19
router.register(r'env_data', views.EnvDataViewSet)
router.register(r'sensor_data_last', views.SensorDataLastViewSet)
995a2ae6   Alexis Koralewski   adding scientific...
20

98621b46   Alexis Koralewski   add DRF, pyros ap...
21
22
urlpatterns = [
    path('', include(router.urls)),
0318e3c9   Alexis Koralewski   Add tests for F05...
23
    path('logout/', views.user_logout, name='logout'),
98621b46   Alexis Koralewski   add DRF, pyros ap...
24
    path('api-token-auth/', obtain_auth_token, name='api_token_auth'),
3c68e37e   Alexis Koralewski   Add API docs to w...
25
    path("submit_sequence", views.submit_sequence_file,
0318e3c9   Alexis Koralewski   Add tests for F05...
26
         name="api_submit_sequence"),
3c68e37e   Alexis Koralewski   Add API docs to w...
27
28
29
30
31
32
33
34
    path("agent_cmd/<str:agent_name>",views.AgentCmdViewSet.as_view({'get': 'list'})),
    path("openapi-schema",get_schema_view(
            title='PyROS API',
            version="1.0.0",
    ), name="openapi-schema"),
    path('docs/', TemplateView.as_view(
        template_name='api/swagger-ui.html',
        extra_context={'schema_url': 'openapi-schema'}
2fa661e0   Alexis Koralewski   Add API docs & AP...
35
    ), name='api_doc'),
0318e3c9   Alexis Koralewski   Add tests for F05...
36
] + router.urls