The ironic.common.glance_service.v2.image_service Module

The ironic.common.glance_service.v2.image_service Module

class ironic.common.glance_service.v2.image_service.GlanceImageService(client=None, version=1, context=None)[source]

Bases: ironic.common.glance_service.base_image_service.BaseImageService, ironic.common.glance_service.service.ImageService

download(image_id, data=None)[source]
show(image_id)[source]
swift_temp_url(image_info)[source]

Generate a no-auth Swift temporary URL.

This function will generate (or return the cached one if temp URL cache is enabled) the temporary Swift URL using the image id from Glance and the config options: ‘swift_endpoint_url’, ‘swift_api_version’, ‘swift_account’ and ‘swift_container’. The temporary URL will be valid for ‘swift_temp_url_duration’ seconds. This allows Ironic to download a Glance image without passing around an auth_token.

Parameters:image_info – The return from a GET request to Glance for a certain image_id. Should be a dictionary, with keys like ‘name’ and ‘checksum’. See https://docs.openstack.org/glance/latest/user/glanceapi.html for examples.
Returns:A signed Swift URL from which an image can be downloaded, without authentication.
Raises:InvalidParameterValue if Swift config options are not set correctly.
Raises:MissingParameterValue if a required parameter is not set.
Raises:ImageUnacceptable if the image info from Glance does not have a image ID.
class ironic.common.glance_service.v2.image_service.TempUrlCacheElement(url, url_expires_at)

Bases: tuple

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.