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
- 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.
- class glance.api.v2.images.RequestDeserializer(schema=None, location_schema=None)[source]¶
Bases:
JSONRequestDeserializer
- class glance.api.v2.images.ResponseSerializer(schema=None, location_schema=None)[source]¶
Bases:
JSONResponseSerializer
- glance.api.v2.images.create_resource(custom_properties=None)[source]¶
Images resource factory method
- 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.