Merge "Testing live migration using qemu"
[yardstick.git] / api / database / v2 / models.py
1 ##############################################################################
2 # Copyright (c) 2017 Huawei Technologies Co.,Ltd.
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 from sqlalchemy import DateTime
15 from sqlalchemy import Boolean
16
17 from api.database import Base
18
19
20 class V2Environment(Base):
21     __tablename__ = 'v2_environment'
22     id = Column(Integer, primary_key=True)
23     uuid = Column(String(30))
24     name = Column(String(30))
25     description = Column(Text)
26     openrc_id = Column(String(10))
27     image_id = Column(String(30))
28     container_id = Column(Text)
29     pod_id = Column(String(10))
30     time = Column(DateTime)
31
32
33 class V2Openrc(Base):
34     __tablename__ = 'v2_openrc'
35     id = Column(Integer, primary_key=True)
36     uuid = Column(String(30))
37     name = Column(String(30))
38     description = Column(Text)
39     environment_id = Column(String(30))
40     content = Column(Text)
41     time = Column(DateTime)
42
43
44 class V2Image(Base):
45     __tablename__ = 'v2_image'
46     id = Column(Integer, primary_key=True)
47     uuid = Column(String(30))
48     name = Column(String(30))
49     description = Column(Text)
50     environment_id = Column(String(30))
51     size = Column(String(30))
52     status = Column(String(30))
53     time = Column(DateTime)
54
55
56 class V2Container(Base):
57     __tablename__ = 'v2_container'
58     id = Column(Integer, primary_key=True)
59     uuid = Column(String(30))
60     name = Column(String(30))
61     environment_id = Column(String(30))
62     status = Column(Integer)
63     port = Column(Integer)
64     time = Column(String(30))
65
66
67 class V2Pod(Base):
68     __tablename__ = 'v2_pod'
69     id = Column(Integer, primary_key=True)
70     uuid = Column(String(30))
71     environment_id = Column(String(30))
72     content = Column(Text)
73     time = Column(String(30))
74
75
76 class V2Project(Base):
77     __tablename__ = 'v2_project'
78     id = Column(Integer, primary_key=True)
79     uuid = Column(String(30))
80     name = Column(String(30))
81     description = Column(Text)
82     time = Column(DateTime)
83     tasks = Column(Text)
84
85
86 class V2Task(Base):
87     __tablename__ = 'v2_task'
88     id = Column(Integer, primary_key=True)
89     uuid = Column(String(30))
90     name = Column(String(30))
91     description = Column(Text)
92     project_id = Column(String(30))
93     environment_id = Column(String(30))
94     time = Column(DateTime)
95     case_name = Column(String(30))
96     suite = Column(Boolean)
97     content = Column(Text)
98     result = Column(Text)
99     error = Column(Text)
100     status = Column(Integer)