2016-12-11 04:05:11 +00:00
|
|
|
# ~*~ coding: utf-8 ~*~
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2018-07-27 10:56:40 +00:00
|
|
|
from django.urls import path
|
2016-12-05 15:02:08 +00:00
|
|
|
from rest_framework.routers import DefaultRouter
|
2020-11-04 06:53:49 +00:00
|
|
|
from rest_framework_bulk.routes import BulkRouter
|
2017-03-22 16:15:25 +00:00
|
|
|
from .. import api
|
2016-12-11 04:05:11 +00:00
|
|
|
|
2016-12-05 15:02:08 +00:00
|
|
|
|
2017-12-12 06:28:12 +00:00
|
|
|
app_name = "ops"
|
|
|
|
|
2017-03-22 16:15:25 +00:00
|
|
|
router = DefaultRouter()
|
2020-11-04 06:53:49 +00:00
|
|
|
bulk_router = BulkRouter()
|
|
|
|
|
|
|
|
bulk_router.register(r'tasks', api.TaskViewSet, 'task')
|
2018-07-13 16:47:21 +00:00
|
|
|
router.register(r'adhoc', api.AdHocViewSet, 'adhoc')
|
2020-03-12 08:24:38 +00:00
|
|
|
router.register(r'adhoc-executions', api.AdHocRunHistoryViewSet, 'execution')
|
2018-12-10 02:11:54 +00:00
|
|
|
router.register(r'command-executions', api.CommandExecutionViewSet, 'command-execution')
|
2019-12-05 07:09:25 +00:00
|
|
|
router.register(r'celery/period-tasks', api.CeleryPeriodTaskViewSet, 'celery-period-task')
|
2017-03-22 16:15:25 +00:00
|
|
|
|
2018-01-08 11:16:28 +00:00
|
|
|
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'),
|
2018-12-10 02:11:54 +00:00
|
|
|
path('celery/task/<uuid:pk>/result/', api.CeleryResultApi.as_view(), name='celery-result'),
|
2020-12-29 13:05:18 +00:00
|
|
|
|
|
|
|
path('ansible/task/<uuid:pk>/log/', api.AnsibleTaskLogApi.as_view(), name='ansible-task-log'),
|
2018-01-08 11:16:28 +00:00
|
|
|
]
|
2017-03-22 16:15:25 +00:00
|
|
|
|
|
|
|
urlpatterns += router.urls
|
2020-11-04 06:53:49 +00:00
|
|
|
urlpatterns += bulk_router.urls
|