From 63e75aad3b01de4fc20468d5dd9cdb9b15c5e11e Mon Sep 17 00:00:00 2001 From: chenjiankun Date: Wed, 4 Jan 2017 17:41:18 +0000 Subject: Add API to get the status of async task JIRA: YARDSTICK-526 Currently there are many API run a task using sub thread. But we don't know the status of this task. So we need to offer a API to query the status of this task. Change-Id: I8d2cc558750bf9270aed4a7abb8bf35d17894d83 Signed-off-by: chenjiankun --- api/database/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'api/database/models.py') diff --git a/api/database/models.py b/api/database/models.py index 25e323842..2fc141c1f 100644 --- a/api/database/models.py +++ b/api/database/models.py @@ -23,3 +23,14 @@ class Tasks(Base): def __repr__(self): return '' % Tasks.task_id + + +class AsyncTasks(Base): + __tablename__ = 'asynctasks' + id = Column(Integer, primary_key=True) + task_id = Column(String(30)) + status = Column(Integer) + error = Column(String(120)) + + def __repr__(self): + return '' % AsyncTasks.task_id -- cgit 1.2.3-korg