diff options
Diffstat (limited to 'openstackclient/compute/client.py')
| -rw-r--r-- | openstackclient/compute/client.py | 22 |
1 files changed, 22 insertions, 0 deletions
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 |
