glance.api package¶
Subpackages¶
- glance.api.glare package
- glance.api.middleware package
- glance.api.v1 package
- glance.api.v2 package
- Subpackages
- glance.api.v2.model package
- Submodules
- glance.api.v2.model.metadef_namespace module
- glance.api.v2.model.metadef_object module
- glance.api.v2.model.metadef_property_item_type module
- glance.api.v2.model.metadef_property_type module
- glance.api.v2.model.metadef_resource_type module
- glance.api.v2.model.metadef_tag module
- Module contents
- glance.api.v2.model package
- Submodules
- glance.api.v2.image_actions module
- glance.api.v2.image_data module
- glance.api.v2.image_members module
- glance.api.v2.image_tags module
- glance.api.v2.images module
- glance.api.v2.metadef_namespaces module
- glance.api.v2.metadef_objects module
- glance.api.v2.metadef_properties module
- glance.api.v2.metadef_resource_types module
- glance.api.v2.metadef_tags module
- glance.api.v2.router module
- glance.api.v2.schemas module
- glance.api.v2.tasks module
- Module contents
- Subpackages
Submodules¶
glance.api.authorization module¶
Bases:
glance.domain.proxy.Image
Bases:
glance.domain.proxy.Repo
Bases:
object
Bases:
list
Bases:
object
Bases:
object
Bases:
object
Bases:
object
Bases:
object
Bases:
object
Bases:
dict
Bases:
set
Bases:
object
Bases:
object
Bases:
glance.domain.proxy.Task
Bases:
glance.domain.proxy.TaskRepo
Return True if the image is mutable in this context.
Return True if the image is mutable in this context.
Return True if the meta_resource_type is mutable in this context.
Return True if the namespace is mutable in this context.
Return True if the object is mutable in this context.
Return True if the object is mutable in this context.
Return True if the tag is mutable in this context.
Return True if the task is mutable in this context.
Return True if the task stub is mutable in this context.
glance.api.cached_images module¶
Controller for Image Cache Management API
-
class
glance.api.cached_images.
Controller
[source]¶ Bases:
glance.api.v1.controller.BaseController
A controller for managing cached images.
-
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_cached_images
(req)[source]¶ GET /cached_images
Returns a mapping of records about cached images.
-
glance.api.common module¶
-
glance.api.common.
check_quota
(context, image_size, db_api, image_id=None)[source]¶ Method called to see if the user is allowed to store an image.
Checks if it is allowed based on the given size in glance based on their quota and current usage.
Parameters: - context –
- image_size – The size of the image we hope to store
- db_api – The db_api in use for this configuration
- image_id – The image that will be replaced with this new data size
Returns:
-
glance.api.common.
get_remaining_quota
(context, db_api, image_id=None)[source]¶ Method called to see if the user is allowed to store an image.
Checks if it is allowed based on the given size in glance based on their quota and current usage.
Parameters: - context –
- db_api – The db_api in use for this configuration
- image_id – The image that will be replaced with this new data size
Returns: The number of bytes the user has remaining under their quota. None means infinity
-
glance.api.common.
get_thread_pool
(lock_name, size=1024)[source]¶ Initializes eventlet thread pool.
If thread pool is present in cache, then returns it from cache else create new pool, stores it in cache and return newly created pool.
@param lock_name: Name of the lock. @param size: Size of eventlet pool.
@return: eventlet pool
glance.api.policy module¶
Policy Engine For Glance
-
class
glance.api.policy.
Enforcer
[source]¶ Bases:
oslo_policy.policy.Enforcer
Responsible for loading and enforcing rules
-
check
(context, action, target)[source]¶ Verifies that the action is valid on the target in this context.
Parameters: - context – Glance request context
- action – String representing the action to be checked
- target – Dictionary representing the object of the action.
Returns: A non-False value if access is allowed.
-
check_is_admin
(context)[source]¶ Check if the given context is associated with an admin role, as defined via the ‘context_is_admin’ RBAC rule.
Parameters: context – Glance request context Returns: A non-False value if context role is admin.
-
enforce
(context, action, target)[source]¶ Verifies that the action is valid on the target in this context.
Parameters: - context – Glance request context
- action – String representing the action to be checked
- target – Dictionary representing the object of the action.
Raises: glance.common.exception.Forbidden
Returns: A non-False value if access is allowed.
-
-
class
glance.api.policy.
ImageLocationsProxy
(locations, context, policy)[source]¶ Bases:
object
-
append
(*args, **kwargs)¶
-
count
(*args, **kwargs)¶
-
extend
(*args, **kwargs)¶
-
index
(*args, **kwargs)¶
-
insert
(*args, **kwargs)¶
-
pop
(*args, **kwargs)¶
-
remove
(*args, **kwargs)¶
-
reverse
(*args, **kwargs)¶
-
-
class
glance.api.policy.
ImageMemberRepoProxy
(member_repo, image, context, policy)[source]¶ Bases:
glance.domain.proxy.Repo
-
class
glance.api.policy.
ImageProxy
(image, context, policy)[source]¶ Bases:
glance.domain.proxy.Image
-
locations
¶
-
visibility
¶
-
-
class
glance.api.policy.
ImageRepoProxy
(image_repo, context, policy)[source]¶ Bases:
glance.domain.proxy.Repo
-
class
glance.api.policy.
ImageTarget
(target)[source]¶ Bases:
_abcoll.Mapping
-
SENTINEL
= <object object>¶
-
-
class
glance.api.policy.
MetadefNamespaceFactoryProxy
(meta_namespace_factory, context, policy)[source]¶
-
class
glance.api.policy.
MetadefNamespaceRepoProxy
(namespace_repo, context, namespace_policy)[source]¶
-
class
glance.api.policy.
MetadefPropertyFactoryProxy
(namespace_property_factory, context, policy)[source]¶
-
class
glance.api.policy.
MetadefResourceTypeFactoryProxy
(resource_type_factory, context, policy)[source]¶
-
class
glance.api.policy.
MetadefResourceTypeRepoProxy
(resource_type_repo, context, resource_type_policy)[source]¶
-
class
glance.api.policy.
MetadefTagRepoProxy
(tag_repo, context, tag_policy)[source]¶ Bases:
glance.domain.proxy.MetadefTagRepo
-
class
glance.api.policy.
TaskProxy
(task, context, policy)[source]¶ Bases:
glance.domain.proxy.Task
-
class
glance.api.policy.
TaskRepoProxy
(task_repo, context, task_policy)[source]¶ Bases:
glance.domain.proxy.TaskRepo
-
class
glance.api.policy.
TaskStubProxy
(task_stub, context, policy)[source]¶ Bases:
glance.domain.proxy.TaskStub
glance.api.property_protections module¶
-
class
glance.api.property_protections.
ExtraPropertiesProxy
(context, extra_props, property_rules)[source]¶
-
class
glance.api.property_protections.
ProtectedImageFactoryProxy
(image_factory, context, property_rules)[source]¶
-
class
glance.api.property_protections.
ProtectedImageProxy
(image, context, property_rules)[source]¶ Bases:
glance.domain.proxy.Image