summaryrefslogtreecommitdiffstats
path: root/api/database
diff options
context:
space:
mode:
authorchenjiankun <chenjiankun1@huawei.com>2017-07-17 07:40:09 +0000
committerchenjiankun <chenjiankun1@huawei.com>2017-07-17 07:40:09 +0000
commit6444f136ec83856e7d9beabf765124d2a6d18466 (patch)
tree0d6a1bac0ba7346048d06121b8b5d56f29e98fb8 /api/database
parent146e193c209fe654c4aeb88e9a2564df9960a8e4 (diff)
Add API(v2) to create grafana
JIRA: YARDSTICK-727 API: /api/v2/yardstick/containers/action METHOD: POST PARAMS: { 'action': 'create_influxdb', 'args': { 'environment_id': environment_id } } Change-Id: I12fc23261ba62df6f923a4d34455ad8b46c4aa8f Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'api/database')
-rw-r--r--api/database/v2/handlers.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/api/database/v2/handlers.py b/api/database/v2/handlers.py
index 095ad724c..3474af2c1 100644
--- a/api/database/v2/handlers.py
+++ b/api/database/v2/handlers.py
@@ -122,6 +122,12 @@ class V2ContainerHandler(object):
raise ValueError
return container
+ def update_attr(self, uuid, attr):
+ container = self.get_by_uuid(uuid)
+ for k, v in attr.items():
+ setattr(container, k, v)
+ db_session.commit()
+
def delete_by_uuid(self, uuid):
container = self.get_by_uuid(uuid)
db_session.delete(container)