2016-11-16 10:12:14 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
|
2016-12-25 09:44:39 +00:00
|
|
|
from django.conf.urls import url
|
2016-11-16 10:12:14 +00:00
|
|
|
from rest_framework import routers
|
|
|
|
|
|
|
|
from .. import api
|
|
|
|
|
2017-12-01 09:28:47 +00:00
|
|
|
app_name = 'terminal'
|
2016-11-16 10:12:14 +00:00
|
|
|
|
|
|
|
router = routers.DefaultRouter()
|
2017-12-14 13:27:14 +00:00
|
|
|
router.register(r'v1/terminal/(?P<terminal>[a-zA-Z0-9\-]{36})?/?status', api.StatusViewSet, 'terminal-status')
|
2017-12-18 10:38:30 +00:00
|
|
|
router.register(r'v1/terminal/(?P<terminal>[a-zA-Z0-9\-]{36})?/?sessions', api.SessionViewSet, 'terminal-sessions')
|
2017-12-03 12:42:36 +00:00
|
|
|
router.register(r'v1/tasks', api.TaskViewSet, 'tasks')
|
2017-11-22 02:54:59 +00:00
|
|
|
router.register(r'v1/terminal', api.TerminalViewSet, 'terminal')
|
2017-12-03 12:42:36 +00:00
|
|
|
router.register(r'v1/command', api.CommandViewSet, 'command')
|
2018-02-25 14:36:42 +00:00
|
|
|
router.register(r'v1/sessions', api.SessionViewSet, 'session')
|
|
|
|
router.register(r'v1/status', api.StatusViewSet, 'session')
|
2016-11-16 10:12:14 +00:00
|
|
|
|
2016-12-25 09:44:39 +00:00
|
|
|
urlpatterns = [
|
2017-12-18 10:38:30 +00:00
|
|
|
url(r'^v1/sessions/(?P<pk>[0-9a-zA-Z\-]{36})/replay/$',
|
|
|
|
api.SessionReplayViewSet.as_view({'get': 'retrieve', 'post': 'create'}),
|
|
|
|
name='session-replay'),
|
2018-03-07 03:28:42 +00:00
|
|
|
url(r'^v1/tasks/kill-session/', api.KillSessionAPI.as_view(), name='kill-session'),
|
2018-04-24 00:23:34 +00:00
|
|
|
url(r'^v1/terminal/(?P<terminal>[a-zA-Z0-9\-]{36})/access-key', api.TerminalTokenApi.as_view(),
|
|
|
|
name='terminal-access-key'),
|
2018-01-21 07:12:59 +00:00
|
|
|
url(r'^v1/terminal/config', api.TerminalConfig.as_view(), name='terminal-config'),
|
2018-04-24 00:23:34 +00:00
|
|
|
# v2: get session's replay
|
|
|
|
url(r'^v2/sessions/(?P<pk>[0-9a-zA-Z\-]{36})/replay/$',
|
|
|
|
api.SessionReplayV2ViewSet.as_view({'get': 'retrieve'}),
|
|
|
|
name='session-replay-v2'),
|
2016-12-25 09:44:39 +00:00
|
|
|
]
|
2016-11-16 10:12:14 +00:00
|
|
|
|
2016-12-30 14:21:50 +00:00
|
|
|
urlpatterns += router.urls
|