summaryrefslogtreecommitdiffstats
path: root/api/database
diff options
context:
space:
mode:
authorJing Lu <lvjing5@huawei.com>2017-07-19 08:17:49 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-07-19 08:17:49 +0000
commitc65afc527dba2f409506aa5f723dd94593dd0dac (patch)
treeb7397b20798de2fff28b07325208aaa5dba967cd /api/database
parent6febc2e33d6ced9b4182cf8d026e65fe983752fc (diff)
parent6444f136ec83856e7d9beabf765124d2a6d18466 (diff)
Merge "Add API(v2) to create grafana"
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)