feat: 增加异步任务api

This commit is contained in:
Aaron3S
2022-10-24 20:14:18 +08:00
parent 1372d6322d
commit 64e03a4412
10 changed files with 178 additions and 27 deletions

View File

@@ -6,7 +6,6 @@ from rest_framework.routers import DefaultRouter
from rest_framework_bulk.routes import BulkRouter
from .. import api
app_name = "ops"
router = DefaultRouter()
@@ -15,9 +14,11 @@ bulk_router = BulkRouter()
router.register(r'adhoc', api.AdHocViewSet, 'adhoc')
router.register(r'adhoc-executions', api.AdHocExecutionViewSet, 'execution')
router.register(r'celery/period-tasks', api.CeleryPeriodTaskViewSet, 'celery-period-task')
router.register(r'celery/tasks', api.CeleryTaskViewSet, 'celery-task')
router.register(r'celery/task-executions', api.CeleryTaskExecutionViewSet, 'task-execution')
urlpatterns = [
path('celery/task/<uuid:pk>/log/', api.CeleryTaskLogApi.as_view(), name='celery-task-log'),
path('celery/task/<uuid:pk>/log/', api.CeleryTaskExecutionLogApi.as_view(), name='celery-task-log'),
path('celery/task/<uuid:pk>/result/', api.CeleryResultApi.as_view(), name='celery-result'),
path('ansible/task/<uuid:pk>/log/', api.AnsibleTaskLogApi.as_view(), name='ansible-task-log'),