Implementation of an image service that uses Glance as the backend
Bases: object
Provides storage and retrieval of disk image objects within Glance.
Store the image data and return the new image id.
Raises : | AlreadyExists if the image already exist. |
---|
Delete the given image.
Raises : | ImageNotFound if the image does not exist. |
---|---|
Raises : | NotAuthorized if the user is not an owner. |
Clears out all images.
Calls out to Glance for a list of detailed image information.
Calls out to Glance for metadata and data and writes data.
Returns a dict with image data for the given opaque image id.
Replace the contents of the given image with the new data.
Raises : | ImageNotFound if the image does not exist. |
---|
Create an image_service and parse the id from the given image_href.
The image_href param can be an href of the form ‘http://example.com:9292/v1/images/b8b2c6f7-7345-4e2f-afa2-eedaba9cbbe3‘, or just an id such as ‘b8b2c6f7-7345-4e2f-afa2-eedaba9cbbe3’. If the image_href is a standalone id, then the default image service is returned.
Parameters: | image_href – href that describes the location of an image |
---|---|
Returns: | a tuple of the form (image_service, image_id) |
Return which Glance API server to use for the request
This method provides a very primitive form of load-balancing suitable for testing and sandbox environments. In production, it would be better to use one IP and route that to a real load-balancer.
Returns (host, port)