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:
objectA 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_cached_nodes(req, image_id)[source]¶
GET /cache/nodes/<IMAGE_ID> - Get all nodes where image is cached
Returns a list of node URLs where the specified image is cached.
- Parameters:
req – The request object
image_id – The image ID to check for cached nodes
- Returns:
List of node URLs where the image is cached
- Raises:
HTTPConflict – If centralized caching is not enabled
HTTPNotFound – If the image does not exist
HTTPForbidden – If policy enforcement fails
- get_queued_images(req)[source]¶
GET /queued_images
Returns a mapping of records about queued images.
- class glance.api.v2.cached_images.CacheWorker(*args, **kwargs)[source]¶
Bases:
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.
- class glance.api.v2.cached_images.CachedImageDeserializer[source]¶
Bases:
JSONRequestDeserializer
- class glance.api.v2.cached_images.CachedImageSerializer[source]¶
Bases:
JSONResponseSerializer