aboutsummaryrefslogtreecommitdiffstats
path: root/api/database
diff options
context:
space:
mode:
authorchenjiankun <chenjiankun1@huawei.com>2017-08-11 09:26:22 +0000
committerchenjiankun <chenjiankun1@huawei.com>2017-08-24 03:29:25 +0000
commitefb4f088f14aee394599bea21973f82f1867c4fe (patch)
tree7dee3588a21ac0b3aa6d130a77d6d6a8f30a01d7 /api/database
parent4a5bc16d841221e8ac7853b3044e50af0c8143d2 (diff)
Add function to upload image from local/url in GUI
JIRA: YARDSTICK-782 As user, we need to upload image from local/url. If upload image from local, user need to choose local image, then we will load it to openstack. If upload image from url, we will download it and load it to openstack. Change-Id: Ia9a42fda15a1dfc91476643635343a2f77a94a6b Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'api/database')
-rw-r--r--api/database/v2/handlers.py5
-rw-r--r--api/database/v2/models.py3
2 files changed, 5 insertions, 3 deletions
diff --git a/api/database/v2/handlers.py b/api/database/v2/handlers.py
index 1bc32bf0e..e4f1dd668 100644
--- a/api/database/v2/handlers.py
+++ b/api/database/v2/handlers.py
@@ -87,6 +87,11 @@ class V2ImageHandler(object):
raise ValueError
return image
+ def delete_by_uuid(self, uuid):
+ image = self.get_by_uuid(uuid)
+ db_session.delete(image)
+ db_session.commit()
+
class V2PodHandler(object):
diff --git a/api/database/v2/models.py b/api/database/v2/models.py
index 1e85559cb..59dab3ebc 100644
--- a/api/database/v2/models.py
+++ b/api/database/v2/models.py
@@ -48,9 +48,6 @@ class V2Image(Base):
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):