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)[source]

Bases: object

A controller for managing cached images.

clear_cache(req)[source]

DELETE /cache - Clear cache and queue

Removes all images from cache and queue.

delete_cache_entry(req, image_id)[source]

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

Removes the image from cache or queue.

delete_cached_image(req, image_id)[source]

DELETE /cached_images/<IMAGE_ID>

Removes an image from the cache.

delete_cached_images(req)[source]

DELETE /cached_images - Clear all active cached images

Removes all images from the cache.

delete_queued_image(req, image_id)[source]

DELETE /queued_images/<IMAGE_ID>

Removes an image from the cache.

delete_queued_images(req)[source]

DELETE /queued_images - Clear all active queued images

Removes all images from the cache.

get_cache_state(req)[source]

GET /cache/ - Get currently cached and queued images

Returns dict of cached and queued images

get_cached_images(req)[source]

GET /cached_images

Returns a mapping of records about cached images.

get_queued_images(req)[source]

GET /queued_images

Returns a mapping of records about queued images.

image_exists_in_cache(image_id)[source]
queue_image(req, image_id)[source]

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)[source]

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)[source]

Bases: threading.Thread

EXIT_SENTINEL = <object object>
run()[source]

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)[source]
terminate()[source]
class glance.api.v2.cached_images.CachedImageDeserializer[source]

Bases: glance.common.wsgi.JSONRequestDeserializer

class glance.api.v2.cached_images.CachedImageSerializer[source]

Bases: glance.common.wsgi.JSONResponseSerializer

clear_cache(response, result)[source]
delete_cache_entry(response, result)[source]
queue_image_from_api(response, result)[source]
glance.api.v2.cached_images.create_resource()[source]

Cached Images resource factory method