1 ##############################################################################
2 # Copyright (c) 2016 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 Tasks
13 class TasksHandler(object):
15 def insert(self, kwargs):
16 task = Tasks(**kwargs)
21 def update_status(self, task, status):
25 def update_error(self, task, error):
29 def get_task_by_taskid(self, task_id):
30 task = Tasks.query.filter_by(task_id=task_id).first()