From 7d33401ee322e92416399a70a9d3116a2aba4335 Mon Sep 17 00:00:00 2001 From: Peter Stachowski Date: Tue, 8 Mar 2016 00:24:41 -0500 Subject: Server support for instance module feature This changeset handles the details of applying, removing, listing and retrieving 'modules' from Trove instances. See https://review.openstack.org/#/c/290177 for the corresponding troveclient changes. Scenario tests have been extended to cover the new functionality. These tests can be run by: ./redstack int-tests --group=module A sample module type 'driver' - ping - is included that simply parses the module contents for a message=Text string and returns the 'Text' as the status message. If no 'message=' tag is found, then the driver reports an error message. Due to time constraints, a few unimplemented parts/tests of the blueprint have been triaged as bugs and are scheduled to be fixed before mitaka-rc1. These include: Vertica license module driver: https://bugs.launchpad.net/trove/+bug/1554898 Incomplete module-instances command: https://bugs.launchpad.net/trove/+bug/1554900 Incomplete 'live-update' of modules: https://bugs.launchpad.net/trove/+bug/1554903 Co-Authored-by: Peter Stachowski Co-Authored-by: Simon Chang Partially Implements: blueprint module-management Change-Id: Ia8d3ff2f4560a6d997df99d41012ea61fb0096f7 Depends-On: If62f5e51d4628cc6a8b10303d5c3893b3bd5057e --- trove/guestagent/api.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'trove/guestagent/api.py') diff --git a/trove/guestagent/api.py b/trove/guestagent/api.py index 54496def..77e62cba 100644 --- a/trove/guestagent/api.py +++ b/trove/guestagent/api.py @@ -227,7 +227,8 @@ class API(object): def prepare(self, memory_mb, packages, databases, users, device_path='/dev/vdb', mount_point='/mnt/volume', backup_info=None, config_contents=None, root_password=None, - overrides=None, cluster_config=None, snapshot=None): + overrides=None, cluster_config=None, snapshot=None, + modules=None): """Make an asynchronous call to prepare the guest as a database container optionally includes a backup id for restores """ @@ -246,7 +247,7 @@ class API(object): device_path=device_path, mount_point=mount_point, backup_info=backup_info, config_contents=config_contents, root_password=root_password, overrides=overrides, - cluster_config=cluster_config, snapshot=snapshot) + cluster_config=cluster_config, snapshot=snapshot, modules=modules) def _create_guest_queue(self): """Call to construct, start and immediately stop rpc server in order @@ -434,7 +435,7 @@ class API(object): LOG.debug("Retrieving guest log list for %s.", self.id) result = self._call("guest_log_list", AGENT_HIGH_TIMEOUT, self.version_cap) - LOG.debug("guest_log_list 1 returns %s", result) + LOG.debug("guest_log_list returns %s", result) return result def guest_log_action(self, log_name, enable, disable, publish, discard): @@ -443,3 +444,21 @@ class API(object): self.version_cap, log_name=log_name, enable=enable, disable=disable, publish=publish, discard=discard) + + def module_list(self, include_contents): + LOG.debug("Querying modules on %s (contents: %s).", + self.id, include_contents) + result = self._call("module_list", AGENT_HIGH_TIMEOUT, + self.version_cap, + include_contents=include_contents) + return result + + def module_apply(self, modules): + LOG.debug("Applying modules to %s.", self.id) + return self._call("module_apply", AGENT_HIGH_TIMEOUT, + self.version_cap, modules=modules) + + def module_remove(self, module): + LOG.debug("Removing modules from %s.", self.id) + return self._call("module_remove", AGENT_HIGH_TIMEOUT, + self.version_cap, module=module) -- cgit v1.2.1