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

add_location(req, image_id, body)[source]
create(req, image, extra_properties, tags)[source]
delete(req, image_id)[source]
delete_from_store(req, store_id, image_id)[source]
get_locations(req, 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]

Return the host from extra_properties for any key in PROXYABLE_HOSTS if it is not a local host.

Parameters:

image – The Image from the repo

Returns:

host string if proxyable, else None

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, location_schema=None)[source]

Bases: JSONRequestDeserializer

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

Bases: JSONResponseSerializer

add_location(response, result)[source]
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_add_location_properties()[source]
glance.api.v2.images.get_base_properties()[source]
glance.api.v2.images.get_collection_schema(custom_properties=None)[source]
glance.api.v2.images.get_location_schema()[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.