From 6444f136ec83856e7d9beabf765124d2a6d18466 Mon Sep 17 00:00:00 2001 From: chenjiankun Date: Mon, 17 Jul 2017 07:40:09 +0000 Subject: 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 --- api/database/v2/handlers.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'api/database') 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) -- cgit 1.2.3-korg