From 269d088947e93ca5f84366d4542ead5457049bb3 Mon Sep 17 00:00:00 2001 From: Steven Tran Date: Mon, 20 Apr 2015 17:54:25 -0700 Subject: [PATCH] Add client datasource action API for action-execution-interface The changes add function to call datasource action API to execute and action on a specified service, e.g. POST v1/data-sources/nova?action=execute Implements: blueprint action-execution-interface Change-Id: I34568c7e853245b85a40da7e9f17aa098bd32089 --- congressclient/v1/client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/congressclient/v1/client.py b/congressclient/v1/client.py index 90891cb..4d1a058 100644 --- a/congressclient/v1/client.py +++ b/congressclient/v1/client.py @@ -167,6 +167,12 @@ class Client(object): self.datasource_path % datasource) return body + def execute_datasource_action(self, service_name, action, body): + uri = "?action=%s" % (action) + resp, body = self.httpclient.post( + (self.datasource_path % service_name) + str(uri), body=body) + return body + def list_drivers(self): resp, body = self.httpclient.get(self.driver) return body