summaryrefslogtreecommitdiffstats
path: root/api/database/v2/models.py
diff options
context:
space:
mode:
authorJing Lu <lvjing5@huawei.com>2017-07-12 02:54:02 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-07-12 02:54:02 +0000
commit0832b64daeeae389db660d87c139e82c1c6593f8 (patch)
tree43b56208411abf35466dcc6185c2a1d5c7ba4154 /api/database/v2/models.py
parent7949507437f8b1b1d9100bd13cf2d90bae60279d (diff)
parente6b3c9dbeb1210af5f0f84b4a582f65d2d31058b (diff)
Merge "Yardstick api database v2 model"
Diffstat (limited to 'api/database/v2/models.py')
-rw-r--r--api/database/v2/models.py100
1 files changed, 100 insertions, 0 deletions
diff --git a/api/database/v2/models.py b/api/database/v2/models.py
new file mode 100644
index 000000000..64d49cc9d
--- /dev/null
+++ b/api/database/v2/models.py
@@ -0,0 +1,100 @@
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+from __future__ import absolute_import
+from sqlalchemy import Column
+from sqlalchemy import Integer
+from sqlalchemy import String
+from sqlalchemy import Text
+from sqlalchemy import DateTime
+from sqlalchemy import Boolean
+
+from api.database import Base
+
+
+class V2Environment(Base):
+ __tablename__ = 'v2_environment'
+ id = Column(Integer, primary_key=True)
+ uuid = Column(String(30))
+ name = Column(String(30))
+ description = Column(Text)
+ openrc_id = Column(String(10))
+ image_id = Column(String(30))
+ container_id = Column(Text)
+ pod_id = Column(String(10))
+ time = Column(DateTime)
+
+
+class V2Openrc(Base):
+ __tablename__ = 'V2_openrc'
+ id = Column(Integer, primary_key=True)
+ uuid = Column(String(30))
+ name = Column(String(30))
+ description = Column(Text)
+ environment_id = Column(String(30))
+ content = Column(Text)
+ time = Column(DateTime)
+
+
+class V2Image(Base):
+ __tablename__ = 'v2_image'
+ id = Column(Integer, primary_key=True)
+ uuid = Column(String(30))
+ name = Column(String(30))
+ description = Column(Text)
+ environment_id = Column(String(30))
+ size = Column(String(30))
+ status = Column(String(30))
+ time = Column(DateTime)
+
+
+class V2Container(Base):
+ __tablename__ = 'v2_container'
+ id = Column(Integer, primary_key=True)
+ uuid = Column(String(30))
+ name = Column(String(30))
+ environment_id = Column(String(30))
+ status = Column(Integer)
+ port = Column(Integer)
+ time = Column(String(30))
+
+
+class V2Pod(Base):
+ __tablename__ = 'v2_pod'
+ id = Column(Integer, primary_key=True)
+ uuid = Column(String(30))
+ environment_id = Column(String(30))
+ content = Column(Text)
+ time = Column(String(30))
+
+
+class V2Project(Base):
+ __tablename__ = 'v2_project'
+ id = Column(Integer, primary_key=True)
+ uuid = Column(String(30))
+ name = Column(String(30))
+ description = Column(Text)
+ time = Column(DateTime)
+ tasks = Column(Text)
+
+
+class V2Task(Base):
+ __tablename__ = 'v2_task'
+ id = Column(Integer, primary_key=True)
+ uuid = Column(String(30))
+ name = Column(String(30))
+ description = Column(Text)
+ project_id = Column(String(30))
+ environment_id = Column(String(30))
+ time = Column(DateTime)
+ case_name = Column(String(30))
+ suite = Column(Boolean)
+ content = Column(Text)
+ result = Column(Text)
+ error = Column(Text)
+ status = Column(Integer)