From 6d5279ddd6db7aa16ef39b5f811702478e07f729 Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Thu, 8 Mar 2018 13:48:40 +0000 Subject: [PATCH] mgr/dashboard: async tasks controller Signed-off-by: Ricardo Dias --- src/pybind/mgr/dashboard/controllers/task.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/pybind/mgr/dashboard/controllers/task.py diff --git a/src/pybind/mgr/dashboard/controllers/task.py b/src/pybind/mgr/dashboard/controllers/task.py new file mode 100644 index 0000000000000..4ec9204b6e104 --- /dev/null +++ b/src/pybind/mgr/dashboard/controllers/task.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import + +from ..tools import ApiController, AuthRequired, RESTController, TaskManager + + +@ApiController('task') +@AuthRequired() +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 + } -- 2.39.5