Add support for glance-download import method

Implements: blueprint glance-download-import-support
Change-Id: Ia2bfad82bccf9acb6103b21112e680c44e295d39
This commit is contained in:
Pranali Deore
2022-08-26 04:18:31 +00:00
parent 75218d289e
commit 92cd70a224
6 changed files with 232 additions and 20 deletions
+10 -2
View File
@@ -353,8 +353,9 @@ class Controller(object):
@utils.add_req_id_to_object()
def image_import(self, image_id, method='glance-direct', uri=None,
backend=None, stores=None, allow_failure=True,
all_stores=None):
remote_region=None, remote_image_id=None,
remote_service_interface=None, backend=None,
stores=None, allow_failure=True, all_stores=None):
"""Import Image via method."""
headers = {}
url = '/v2/images/%s/import' % image_id
@@ -370,6 +371,13 @@ class Controller(object):
if allow_failure:
data['all_stores_must_succeed'] = False
if remote_region and remote_image_id:
if remote_service_interface:
data['method']['glance_service_interface'] = \
remote_service_interface
data['method']['glance_region'] = remote_region
data['method']['glance_image_id'] = remote_image_id
if uri:
if method == 'web-download':
data['method']['uri'] = uri