jumpserver/apps/ops/urls/api_urls.py

22 lines
591 B
Python
Raw Normal View History

# ~*~ coding: utf-8 ~*~
from __future__ import unicode_literals
2018-07-27 10:56:40 +00:00
from django.urls import path
from rest_framework.routers import DefaultRouter
from .. import api
2017-12-12 06:28:12 +00:00
app_name = "ops"
router = DefaultRouter()
2018-07-13 16:47:21 +00:00
router.register(r'tasks', api.TaskViewSet, 'task')
router.register(r'adhoc', api.AdHocViewSet, 'adhoc')
router.register(r'history', api.AdHocRunHistorySet, 'history')
urlpatterns = [
2018-07-27 10:56:40 +00:00
path('tasks/<uuid:pk>/run/', api.TaskRun.as_view(), name='task-run'),
path('celery/task/<uuid:pk>/log/', api.CeleryTaskLogApi.as_view(), name='celery-task-log'),
]
urlpatterns += router.urls