glance.api.v2.images module

class glance.api.v2.images.ImagesController(db_api=None, policy_enforcer=None, notifier=None, store_api=None)[source]

Bases: object

create(req, image, extra_properties, tags)[source]
delete(req, image_id)[source]
delete_from_store(req, store_id, image_id)[source]
get_task_info(req, image_id)[source]
import_image(req, image_id, body)[source]
index(req, marker=None, limit=None, sort_key=None, sort_dir=None, filters=None, member_status='accepted')[source]
is_proxyable(image)[source]

Decide if an action is proxyable to a stage host.

If the image has a staging host recorded with a URL that does not match ours, then we can proxy our request to that host.

Parameters:

image – The Image from the repo

Returns:

bool indicating proxyable status

property self_url

Return the URL we expect to point to us.

If this is set to a per-worker URL in worker_self_reference_url, that takes precedence. Otherwise we fall back to public_endpoint.

show(req, image_id)[source]
update(req, image_id, changes)[source]
class glance.api.v2.images.RequestDeserializer(schema=None)[source]

Bases: JSONRequestDeserializer

create(request)[source]
import_image(request)[source]
index(request)[source]
update(request)[source]
class glance.api.v2.images.ResponseSerializer(schema=None)[source]

Bases: JSONResponseSerializer

create(response, image)[source]
delete(response, result)[source]
delete_from_store(response, result)[source]
import_image(response, result)[source]
index(response, result)[source]
show(response, image)[source]
update(response, image)[source]
glance.api.v2.images.create_resource(custom_properties=None)[source]

Images resource factory method

glance.api.v2.images.get_base_properties()[source]
glance.api.v2.images.get_collection_schema(custom_properties=None)[source]
glance.api.v2.images.get_schema(custom_properties=None)[source]
glance.api.v2.images.load_custom_properties()[source]

Find the schema properties files and load them into a dict.

glance.api.v2.images.proxy_response_error(orig_code, orig_explanation)[source]

Construct a webob.exc.HTTPError exception on the fly.

The webob.exc.HTTPError classes are statically defined, intended to be straight subclasses of HTTPError, specifically with class level definitions of things we need to be dynamic. This method returns an exception class instance with those values set programmatically so we can raise it to mimic the response we got from a remote.