jumpserver/apps/terminal/urls/api_urls.py

39 lines
1.4 KiB
Python
Raw Normal View History

2016-11-16 10:12:14 +00:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from django.urls import path, include
from rest_framework_bulk.routes import BulkRouter
2016-11-16 10:12:14 +00:00
from .. import api
2016-11-16 10:12:14 +00:00
app_name = 'terminal'
2016-11-16 10:12:14 +00:00
router = BulkRouter()
router.register(r'sessions', api.SessionViewSet, 'session')
2018-07-13 16:47:21 +00:00
router.register(r'terminal/(?P<terminal>[a-zA-Z0-9\-]{36})?/?status', api.StatusViewSet, 'terminal-status')
router.register(r'terminal/(?P<terminal>[a-zA-Z0-9\-]{36})?/?sessions', api.SessionViewSet, 'terminal-sessions')
2018-07-25 09:21:13 +00:00
router.register(r'terminal', api.TerminalViewSet, 'terminal')
2018-07-13 16:47:21 +00:00
router.register(r'tasks', api.TaskViewSet, 'tasks')
router.register(r'command', api.CommandViewSet, 'command')
router.register(r'status', api.StatusViewSet, 'status')
2016-11-16 10:12:14 +00:00
2016-12-25 09:44:39 +00:00
urlpatterns = [
2018-07-27 10:56:40 +00:00
path('sessions/<uuid:pk>/replay/',
api.SessionReplayViewSet.as_view({'get': 'retrieve', 'post': 'create'}),
2018-07-27 10:56:40 +00:00
name='session-replay'),
path('tasks/kill-session/', api.KillSessionAPI.as_view(), name='kill-session'),
2018-07-31 03:00:48 +00:00
path('terminal/<uuid:terminal>/access-key/', api.TerminalTokenApi.as_view(),
2018-07-27 10:56:40 +00:00
name='terminal-access-key'),
path('terminal/config/', api.TerminalConfig.as_view(), name='terminal-config'),
# v2: get session's replay
2018-07-27 10:56:40 +00:00
# path('v2/sessions/<uuid:pk>/replay/',
2018-07-25 09:21:13 +00:00
# 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