From 4289ddd47a9c92eb3033eccf39966915caae05db Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Thu, 18 Sep 2014 00:55:58 -0500 Subject: Low-level Compute v2 API: security group api.compute.APIv2 starts with security group functions. novaclient 8.0 is now released without support for the previously deprecated nova-net functions, so include a new low-level REST implementation of the removed APIs. Change-Id: Id007535f0598226a8202716232313e37fe6247f9 --- openstackclient/compute/client.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'openstackclient/compute/client.py') diff --git a/openstackclient/compute/client.py b/openstackclient/compute/client.py index b4b463b4..6abfef04 100644 --- a/openstackclient/compute/client.py +++ b/openstackclient/compute/client.py @@ -31,6 +31,11 @@ API_VERSIONS = { "2.1": "novaclient.client", } +COMPUTE_API_TYPE = 'compute' +COMPUTE_API_VERSIONS = { + '2': 'openstackclient.api.compute_v2.APIv2', +} + # Save the microversion if in use _compute_api_version = None @@ -58,6 +63,13 @@ def make_client(instance): LOG.debug('Instantiating compute client for %s', version) + compute_api = utils.get_client_class( + API_NAME, + version.ver_major, + COMPUTE_API_VERSIONS, + ) + LOG.debug('Instantiating compute api: %s', compute_api) + # Set client http_log_debug to True if verbosity level is high enough http_log_debug = utils.get_effective_log_level() <= logging.DEBUG @@ -77,6 +89,16 @@ def make_client(instance): **kwargs ) + client.api = compute_api( + session=instance.session, + service_type=COMPUTE_API_TYPE, + endpoint=instance.get_endpoint_for_service_type( + COMPUTE_API_TYPE, + region_name=instance.region_name, + interface=instance.interface, + ) + ) + return client -- cgit v1.2.1