Bases: object
Same as get_image_meta_or_404 except that it will raise a 403 if the image is deactivated or 404 if the image is otherwise not ‘active’.
/images endpoint for Glance v1 API
Bases: glance.api.v1.controller.BaseController
WSGI controller for images resource in Glance v1 API
The images resource API is a RESTful web service for image data. The API is as follows:
GET /images -- Returns a set of brief metadata about images
GET /images/detail -- Returns a set of detailed metadata about
images
HEAD /images/<ID> -- Return metadata about an image with id <ID>
GET /images/<ID> -- Return image data for image with id <ID>
POST /images -- Store image data and return metadata about the
newly-stored image
PUT /images/<ID> -- Update image metadata and/or upload image
data for a previously-reserved image
DELETE /images/<ID> -- Delete the image with id <ID>
Adds a new image to Glance. Four scenarios exist when creating an image:
The request body must be encoded as application/octet-stream, otherwise an HTTPBadRequest is returned.
Upon a successful save of the image data and metadata, a response containing metadata about the image is returned, including its opaque identifier.
Parameters: |
|
---|---|
Raises: | HTTPBadRequest if x-image-meta-location is missing and the request body is not application/octet-stream image data. |
Deletes the image and all its chunks from the Glance
Parameters: |
|
---|---|
Raises: | HttpBadRequest if image registry is invalid |
Raises: | HttpNotFound if image or any chunk is not available |
Raises: | HttpUnauthorized if image or any chunk is not deleteable by the requesting user |
Returns detailed information for all available images
Parameters: | req – The WSGI/Webob Request object |
---|
:retval The response body is a mapping of the following form:
{'images': [
{'id': <ID>,
'name': <NAME>,
'size': <SIZE>,
'disk_format': <DISK_FORMAT>,
'container_format': <CONTAINER_FORMAT>,
'checksum': <CHECKSUM>,
'min_disk': <MIN_DISK>,
'min_ram': <MIN_RAM>,
'store': <STORE>,
'status': <STATUS>,
'created_at': <TIMESTAMP>,
'updated_at': <TIMESTAMP>,
'deleted_at': <TIMESTAMP>|<NONE>,
'properties': {'distro': 'Ubuntu 10.04 LTS', ...}}, ...
]}
Grabs the storage backend for the supplied store name or raises an HTTPBadRequest (400) response
Parameters: |
|
---|---|
Raises: | HTTPBadRequest if store does not exist |
Returns the following information for all public, available images:
- id – The opaque image identifier
- name – The name of the image
- disk_format – The disk image format
- container_format – The “container” format of the image
- checksum – MD5 checksum of the image data
- size – Size of image data in bytes
Parameters: | req – The WSGI/Webob Request object |
---|
:retval The response body is a mapping of the following form:
{'images': [
{'id': <ID>,
'name': <NAME>,
'disk_format': <DISK_FORMAT>,
'container_format': <DISK_FORMAT>,
'checksum': <CHECKSUM>
'size': <SIZE>}, ...
]}
Returns metadata about an image in the HTTP headers of the response object
Parameters: |
|
---|
:retval similar to ‘show’ method but without image_data
Raises: | HTTPNotFound if image metadata is not available to user |
---|
Bases: glance.common.wsgi.JSONRequestDeserializer
Handles deserialization of specific controller method requests.
Bases: glance.common.wsgi.JSONResponseSerializer
Handles serialization of specific controller method responses.
Bases: glance.api.v1.controller.BaseController
This will cover the missing ‘show’ and ‘create’ actions
Return a list of dictionaries indicating the members of the image, i.e., those tenants the image is shared with.
Parameters: |
|
---|
:retval The response body is a mapping of the following form:
{'members': [
{'member_id': <MEMBER>,
'can_share': <SHARE_PERMISSION>, ...}, ...
]}
Retrieves list of image memberships for the given member.
Parameters: |
|
---|
:retval The response body is a mapping of the following form:
{'shared_images': [
{'image_id': <IMAGE>,
'can_share': <SHARE_PERMISSION>, ...}, ...
]}
Adds a membership to the image, or updates an existing one. If a body is present, it is a dict with the following format:
{"member": {
"can_share": [True|False]
}}
If “can_share” is provided, the member’s ability to share is set accordingly. If it is not provided, existing memberships remain unchanged and new memberships default to False.
Bases: glance.common.wsgi.Router
WSGI router for Glance v1 API requests.
Deletes image data from the location of backend store.
Parameters: |
|
---|
Mark image killed without raising exceptions if it fails.
Since _kill is meant to be called from exceptions handlers, it should not raise itself, rather it should just log its error.
Parameters: |
|
---|