jumpserver/apps/terminal/urls/api_urls.py

36 lines
1.4 KiB
Python
Raw Normal View History

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
app_name = 'terminal'
2016-11-16 10:12:14 +00:00
router = routers.DefaultRouter()
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')
router.register(r'v1/tasks', api.TaskViewSet, 'tasks')
2017-11-22 02:54:59 +00:00
router.register(r'v1/terminal', api.TerminalViewSet, 'terminal')
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'),
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'),
# 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