Merge "Enable vnf/tg instantiate as blocking call."
[yardstick.git] / api / database / v1 / models.py
1 ##############################################################################
2 # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
3 #
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
13 from sqlalchemy import Text
14
15 from api.database import Base
16
17
18 class Tasks(Base):
19     __tablename__ = 'tasks'
20     id = Column(Integer, primary_key=True)
21     task_id = Column(String(30))
22     status = Column(Integer)
23     error = Column(String(120))
24     result = Column(Text)
25     details = Column(String(120))
26
27     def __repr__(self):
28         return '<Task %r>' % Tasks.task_id
29
30
31 class AsyncTasks(Base):
32     __tablename__ = 'asynctasks'
33     id = Column(Integer, primary_key=True)
34     task_id = Column(String(30))
35     status = Column(Integer)
36     error = Column(String(120))
37
38     def __repr__(self):
39         return '<Task %r>' % AsyncTasks.task_id