summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/controllers/task.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/pybind/mgr/dashboard/controllers/task.py')
-rw-r--r--src/pybind/mgr/dashboard/controllers/task.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/controllers/task.py b/src/pybind/mgr/dashboard/controllers/task.py
new file mode 100644
index 00000000..9380f070
--- /dev/null
+++ b/src/pybind/mgr/dashboard/controllers/task.py
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+from __future__ import absolute_import
+
+from . import ApiController, RESTController
+from ..tools import TaskManager
+
+
+@ApiController('/task')
+class Task(RESTController):
+ def list(self, name=None):
+ executing_t, finished_t = TaskManager.list_serializable(name)
+ return {
+ 'executing_tasks': executing_t,
+ 'finished_tasks': finished_t
+ }