The ironic.common.glance_service.service
Module¶
-
class
ironic.common.glance_service.service.
ImageService
[source]¶ Bases:
object
Provides storage and retrieval of disk image objects within Glance.
-
create
(image_meta, data=None)[source]¶ Store the image data and return the new image object.
Parameters: - image_meta – A dict containing image metadata
- data – (Optional) File object to create image from.
Returns: dict – New created image metadata
-
delete
(image_id)[source]¶ Delete the given image.
Parameters: image_id – The opaque image identifier. Raises: ImageNotFound if the image does not exist. Raises: NotAuthorized if the user is not an owner. Raises: ImageNotAuthorized if the user is not authorized.
-
download
(image_id, data=None)[source]¶ Calls out to Glance for data and writes data.
Parameters: - image_id – The opaque image identifier.
- data – (Optional) File object to write data to.
-
show
(image_id)[source]¶ Returns a dict with image data for the given opaque image id.
Parameters: image_id – The opaque image identifier. Returns: A dict containing image metadata. Raises: ImageNotFound
-
update
(image_id, image_meta, data=None, purge_props=False)[source]¶ Modify the given image with the new data.
Parameters: - image_id – The opaque image identifier.
- data – (Optional) File object to update data from.
- purge_props – (Optional=True) Purge existing properties.
Returns: dict – New created image metadata
-