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 __future__ import absolute_import
10 from sqlalchemy import Column
11 from sqlalchemy import Integer
12 from sqlalchemy import String
14 from api.database import Base
18 __tablename__ = 'tasks'
19 id = Column(Integer, primary_key=True)
20 task_id = Column(String(30))
21 status = Column(Integer)
22 error = Column(String(120))
23 details = Column(String(120))
26 return '<Task %r>' % Tasks.task_id
29 class AsyncTasks(Base):
30 __tablename__ = 'asynctasks'
31 id = Column(Integer, primary_key=True)
32 task_id = Column(String(30))
33 status = Column(Integer)
34 error = Column(String(120))
37 return '<Task %r>' % AsyncTasks.task_id