1 # ############################################################################
2 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 # ############################################################################
9 from api.database import db_session
10 from api.database.models import AsyncTasks
13 class AsyncTaskHandler(object):
14 def insert(self, kwargs):
15 task = AsyncTasks(**kwargs)
20 def update_status(self, task, status):
24 def update_error(self, task, error):
28 def get_task_by_taskid(self, task_id):
29 task = AsyncTasks.query.filter_by(task_id=task_id).first()