# glance.api.v2.cached_images module

Controller for Image Cache Management API

class glance.api.v2.cached_images.CacheController(db_api=None, policy_enforcer=None, notifier=None, store_api=None)

  Bases: `object`

  A controller for managing cached images.

  clear_cache(req)

    DELETE /cache - Clear cache and queue

    Removes all images from cache and queue.

  delete_cache_entry(req, image_id)

    DELETE /cache/<IMAGE_ID> - Remove image from cache

    Removes the image from cache or queue.

  delete_cached_image(req, image_id)

    DELETE /cached_images/<IMAGE_ID>

    Removes an image from the cache.

  delete_cached_images(req)

    DELETE /cached_images - Clear all active cached images

    Removes all images from the cache.

  delete_queued_image(req, image_id)

    DELETE /queued_images/<IMAGE_ID>

    Removes an image from the cache.

  delete_queued_images(req)

    DELETE /queued_images - Clear all active queued images

    Removes all images from the cache.

  get_cache_state(req)

    GET /cache/ - Get currently cached and queued images

    Returns dict of cached and queued images

  get_cached_images(req)

    GET /cached_images

    Returns a mapping of records about cached images.

  get_queued_images(req)

    GET /queued_images

    Returns a mapping of records about queued images.

  image_exists_in_cache(image_id)
  queue_image(req, image_id)

    PUT /queued_images/<IMAGE_ID>

    Queues an image for caching. We do not check to see if the image is in the registry here. That is done by the prefetcher…

  queue_image_from_api(req, image_id)

    PUT /cache/<IMAGE_ID>

    Queues an image for caching. We do not check to see if the image is in the registry here. That is done by the prefetcher…

class glance.api.v2.cached_images.CacheWorker(*args, **kwargs)

  Bases: `Thread`

  EXIT_SENTINEL = <object object>
  run()

    Method representing the thread’s activity.

    You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

  submit(job)
  terminate()

class glance.api.v2.cached_images.CachedImageDeserializer

  Bases: `JSONRequestDeserializer`

class glance.api.v2.cached_images.CachedImageSerializer

  Bases: `JSONResponseSerializer`

  clear_cache(response, result)
  delete_cache_entry(response, result)
  queue_image_from_api(response, result)

glance.api.v2.cached_images.create_resource()

  Cached Images resource factory method

this page last updated: 2026-04-16 16:57:26

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