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

create(image_meta, data=None)[source]
delete(image_id)[source]
detail(**kwargs)[source]
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 http://docs.openstack.org/developer/glance/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.
update(image_id, image_meta, data=None, purge_props=False)[source]
class ironic.common.glance_service.v2.image_service.TempUrlCacheElement

Bases: tuple

TempUrlCacheElement(url, url_expires_at)

Project Source

This Page