# glance.api.v2.images module

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

  Bases: `object`

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

    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)
  update(req, image_id, changes)

class glance.api.v2.images.RequestDeserializer(schema=None, location_schema=None)

  Bases: `JSONRequestDeserializer`

  add_location(request)
  create(request)
  import_image(request)
  index(request)
  update(request)

class glance.api.v2.images.ResponseSerializer(schema=None, location_schema=None)

  Bases: `JSONResponseSerializer`

  add_location(response, result)
  create(response, image)
  delete(response, result)
  delete_from_store(response, result)
  import_image(response, result)
  index(response, result)
  show(response, image)
  update(response, image)

glance.api.v2.images.create_resource(custom_properties=None)

  Images resource factory method

glance.api.v2.images.get_add_location_properties()

glance.api.v2.images.get_base_properties()

glance.api.v2.images.get_collection_schema(custom_properties=None)

glance.api.v2.images.get_location_schema()

glance.api.v2.images.get_schema(custom_properties=None)

glance.api.v2.images.load_custom_properties()

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

  Supports two formats: 1. Extended format (with required support):

      {"properties": {...}, "required": [...]}

  2. Flat format (backward compatibility):

         {"property_name": {...}, ...}

  Returns:
    dict: Either {‘properties’: {…}, ‘required’: […]}

      for extended format, or {‘properties’: {…}, ‘required’: None} for flat format, or {‘properties’: {}, ‘required’: None} if file not found.

glance.api.v2.images.proxy_response_error(orig_code, orig_explanation)

  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.

this page last updated: 2026-08-19 03:42:39

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug