jumpserver/apps/terminal/urls/api_urls.py

61 lines
3.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, re_path
from rest_framework_bulk.routes import BulkRouter
2016-11-16 10:12:14 +00:00
from common import api as capi
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')
2022-11-07 12:41:18 +00:00
router.register(r'terminals/((?P<terminal>[^/.]{36})/)?status', api.StatusViewSet, 'terminal-status')
router.register(r'terminals/((?P<terminal>[^/.]{36})/)?sessions', api.SessionViewSet, 'terminal-sessions')
router.register(r'terminals', api.TerminalViewSet, 'terminal')
2018-07-13 16:47:21 +00:00
router.register(r'tasks', api.TaskViewSet, 'tasks')
router.register(r'commands', api.CommandViewSet, 'command')
router.register(r'status', api.StatusViewSet, 'status')
Config (#3502) * [Update] 修改config * [Update] 移动存储设置到到terminal中 * [Update] 修改permission 查看 * [Update] pre merge * [Update] 录像存储 * [Update] 命令存储 * [Update] 添加存储测试可连接性 * [Update] 修改 meta 值的 key 为大写 * [Update] 修改 Terminal 相关 Storage 配置 * [Update] 删除之前获取录像/命令存储的代码 * [Update] 修改导入失败 * [Update] 迁移文件添加default存储 * [Update] 删除之前代码,添加help_text信息 * [Update] 删除之前代码 * [Update] 删除之前代码 * [Update] 抽象命令/录像存储 APIView * [Update] 抽象命令/录像存储 APIView 1 * [Update] 抽象命令/录像存储 DictField * [Update] 抽象命令/录像存储列表页面 * [Update] 修复CustomDictField的bug * [Update] RemoteApp 页面添加 hidden * [Update] 用户页面添加用户关联授权 * [Update] 修改存储测试可连接性 target * [Update] 修改配置 * [Update] 修改存储前端 Form 渲染逻辑 * [Update] 修改存储细节 * [Update] 统一存储类型到 const 文件 * [Update] 修改迁移文件及Model,创建默认存储 * [Update] 修改迁移文件及Model初始化默认数据 * [Update] 修改迁移文件 * [Update] 修改迁移文件 * [Update] 修改迁移文件 * [Update] 修改迁移文件 * [Update] 修改迁移文件 * [Update] 修改迁移文件 * [Update] 修改迁移文件 * [Update] 限制删除默认存储配置,只允许创建扩展的存储类型 * [Update] 修改ip字段长度 * [Update] 修改ip字段长度 * [Update] 修改一些css * [Update] 修改关联 * [Update] 添加操作日志定时清理 * [Update] 修改记录syslog的instance encoder * [Update] 忽略登录产生的操作日志 * [Update] 限制更新存储时不覆盖原有AK SK 等字段 * [Update] 修改迁移文件添加comment字段 * [Update] 修改迁移文件 * [Update] 添加 comment 字段 * [Update] 修改默认存储no -> null * [Update] 修改细节 * [Update] 更新翻译(存储配置 * [Update] 修改定时任务注册,修改系统用户资产、节点关系api * [Update] 添加监控磁盘任务 * [Update] 修改session * [Update] 拆分serializer * [Update] 还原setting原来的manager
2019-12-05 07:09:25 +00:00
router.register(r'replay-storages', api.ReplayStorageViewSet, 'replay-storage')
router.register(r'command-storages', api.CommandStorageViewSet, 'command-storage')
router.register(r'session-sharings', api.SessionSharingViewSet, 'session-sharing')
router.register(r'session-join-records', api.SessionJoinRecordsViewSet, 'session-sharing-record')
router.register(r'endpoints', api.EndpointViewSet, 'endpoint')
router.register(r'endpoint-rules', api.EndpointRuleViewSet, 'endpoint-rule')
2022-10-25 04:57:34 +00:00
router.register(r'applets', api.AppletViewSet, 'applet')
2022-11-07 12:41:18 +00:00
router.register(r'applet-hosts/((?P<host>[^/.]+)/)?accounts', api.AppletHostAccountsViewSet, 'applet-host-account')
router.register(r'applet-hosts/((?P<host>[^/.]+)/)?applets', api.AppletHostAppletViewSet, 'applet-host-applet')
2022-10-25 04:57:34 +00:00
router.register(r'applet-hosts', api.AppletHostViewSet, 'applet-host')
2022-10-28 10:19:44 +00:00
router.register(r'applet-publications', api.AppletPublicationViewSet, 'applet-publication')
2022-11-01 03:52:51 +00:00
router.register(r'applet-host-deployments', api.AppletHostDeploymentViewSet, 'applet-host-deployment')
router.register(r'db-listen-ports', api.DBListenPortViewSet, 'db-listen-ports')
2016-11-16 10:12:14 +00:00
2016-12-25 09:44:39 +00:00
urlpatterns = [
2021-12-13 02:50:10 +00:00
path('my-sessions/', api.MySessionAPIView.as_view(), name='my-session'),
2021-01-20 10:33:38 +00:00
path('terminal-registrations/', api.TerminalRegistrationApi.as_view(), name='terminal-registration'),
2022-02-18 06:28:28 +00:00
path('registration/', api.TerminalRegistrationApi.as_view(), name='registration'),
path('sessions/join/validate/', api.SessionJoinValidateAPI.as_view(), name='join-session-validate'),
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'),
path('tasks/kill-session-for-ticket/', api.KillSessionForTicketAPI.as_view(), name='kill-session-for-ticket'),
path('terminals/config/', api.TerminalConfig.as_view(), name='terminal-config'),
path('commands/insecure-command/', api.InsecureCommandAlertAPI.as_view(), name="command-alert"),
2022-11-17 12:48:50 +00:00
path('replay-storages/<uuid:pk>/test-connective/', api.ReplayStorageTestConnectiveApi.as_view(),
name='replay-storage-test-connective'),
path('command-storages/<uuid:pk>/test-connective/', api.CommandStorageTestConnectiveApi.as_view(),
name='command-storage-test-connective'),
# components
path('components/metrics/', api.ComponentsMetricsAPIView.as_view(), name='components-metrics'),
2022-11-17 12:48:50 +00:00
path('components/connect-methods/', api.ConnectMethodListApi.as_view(), name='connect-methods'),
2016-12-25 09:44:39 +00:00
]
2016-11-16 10:12:14 +00:00
old_version_urlpatterns = [
re_path('(?P<resource>terminal|command)/.*', capi.redirect_plural_name_api)
]
urlpatterns += router.urls + old_version_urlpatterns