glance package

Subpackages

Submodules

glance.context module

class glance.context.RequestContext(owner_is_tenant=True, service_catalog=None, policy_enforcer=None, **kwargs)[source]

Bases: oslo_context.context.RequestContext

Stores information about the security context.

Stores how the user accesses the system, as well as additional request information.

can_see_deleted

Admins can see deleted by default

classmethod from_dict(values)[source]
owner

Return the owner to correlate with an image.

to_dict()[source]
to_policy_values()[source]
glance.context.get_admin_context(show_deleted=False)[source]

Create an administrator context.

glance.gateway module

class glance.gateway.Gateway(db_api=None, store_api=None, notifier=None, policy_enforcer=None)[source]

Bases: object

get_image_factory(context)[source]
get_image_member_factory(context)[source]
get_member_repo(image, context)[source]
get_metadef_namespace_factory(context)[source]
get_metadef_namespace_repo(context)[source]
get_metadef_object_factory(context)[source]
get_metadef_object_repo(context)[source]
get_metadef_property_factory(context)[source]
get_metadef_property_repo(context)[source]
get_metadef_resource_type_factory(context)[source]
get_metadef_resource_type_repo(context)[source]
get_metadef_tag_factory(context)[source]
get_metadef_tag_repo(context)[source]
get_repo(context)[source]
get_task_executor_factory(context)[source]
get_task_factory(context)[source]
get_task_repo(context)[source]
get_task_stub_repo(context)[source]

glance.i18n module

glance.location module

class glance.location.ImageFactoryProxy(factory, context, store_api, store_utils)[source]

Bases: glance.domain.proxy.ImageFactory

new_image(**kwargs)[source]
class glance.location.ImageMemberRepoProxy(repo, image, context, store_api)[source]

Bases: glance.domain.proxy.Repo

add(member)[source]
remove(member)[source]
class glance.location.ImageProxy(image, context, store_api, store_utils)[source]

Bases: glance.domain.proxy.Image

delete()[source]
get_data(offset=0, chunk_size=None)[source]
locations
set_data(data, size=None)[source]
class glance.location.ImageRepoProxy(image_repo, context, store_api, store_utils)[source]

Bases: glance.domain.proxy.Repo

add(image)[source]
save(image, from_state=None)[source]
class glance.location.StoreLocations(image_proxy, value)[source]

Bases: _abcoll.MutableSequence

The proxy for store location property. It takes responsibility for:

1. Location uri correctness checking when adding a new location.
2. Remove the image data from the store when a location is removed
   from an image.
append(location)[source]
count(location)[source]
extend(other)[source]
index(location, *args)[source]
insert(i, location)[source]
pop(i=-1)[source]
remove(location)[source]
reverse()[source]

glance.notifier module

class glance.notifier.ImageFactoryProxy(factory, context, notifier)[source]

Bases: glance.notifier.NotificationFactoryProxy, glance.domain.proxy.ImageFactory

get_proxy_class()[source]
get_super_class()[source]
class glance.notifier.ImageMemberProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationProxy, glance.domain.proxy.ImageMember

get_super_class()[source]
class glance.notifier.ImageMemberRepoProxy(repo, image, context, notifier)[source]

Bases: glance.notifier.NotificationBase, glance.domain.proxy.MemberRepo

add(member)[source]
get_payload(obj)[source]
get_proxy_class()[source]
get_super_class()[source]
remove(member)[source]
save(member, from_state=None)[source]
class glance.notifier.ImageProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationProxy, glance.domain.proxy.Image

get_data(offset=0, chunk_size=None)[source]
get_payload(obj)[source]
get_super_class()[source]
set_data(data, size=None)[source]
class glance.notifier.ImageRepoProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationRepoProxy, glance.domain.proxy.Repo

add(image)[source]
get_payload(obj)[source]
get_proxy_class()[source]
get_super_class()[source]
remove(image)[source]
save(image, from_state=None)[source]
class glance.notifier.MetadefNamespaceFactoryProxy(factory, context, notifier)[source]

Bases: glance.notifier.NotificationFactoryProxy, glance.domain.proxy.MetadefNamespaceFactory

get_proxy_class()[source]
get_super_class()[source]
class glance.notifier.MetadefNamespaceProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationProxy, glance.domain.proxy.MetadefNamespace

get_super_class()[source]
class glance.notifier.MetadefNamespaceRepoProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationRepoProxy, glance.domain.proxy.MetadefNamespaceRepo

add(metadef_namespace)[source]
get_payload(obj)[source]
get_proxy_class()[source]
get_super_class()[source]
remove(metadef_namespace)[source]
remove_objects(metadef_namespace)[source]
remove_properties(metadef_namespace)[source]
remove_tags(metadef_namespace)[source]
save(metadef_namespace)[source]
class glance.notifier.MetadefObjectFactoryProxy(factory, context, notifier)[source]

Bases: glance.notifier.NotificationFactoryProxy, glance.domain.proxy.MetadefObjectFactory

get_proxy_class()[source]
get_super_class()[source]
class glance.notifier.MetadefObjectProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationProxy, glance.domain.proxy.MetadefObject

get_super_class()[source]
class glance.notifier.MetadefObjectRepoProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationRepoProxy, glance.domain.proxy.MetadefObjectRepo

add(metadef_object)[source]
get_payload(obj)[source]
get_proxy_class()[source]
get_super_class()[source]
remove(metadef_object)[source]
save(metadef_object)[source]
class glance.notifier.MetadefPropertyFactoryProxy(factory, context, notifier)[source]

Bases: glance.notifier.NotificationFactoryProxy, glance.domain.proxy.MetadefPropertyFactory

get_proxy_class()[source]
get_super_class()[source]
class glance.notifier.MetadefPropertyProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationProxy, glance.domain.proxy.MetadefProperty

get_super_class()[source]
class glance.notifier.MetadefPropertyRepoProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationRepoProxy, glance.domain.proxy.MetadefPropertyRepo

add(metadef_property)[source]
get_payload(obj)[source]
get_proxy_class()[source]
get_super_class()[source]
remove(metadef_property)[source]
save(metadef_property)[source]
class glance.notifier.MetadefResourceTypeFactoryProxy(factory, context, notifier)[source]

Bases: glance.notifier.NotificationFactoryProxy, glance.domain.proxy.MetadefResourceTypeFactory

get_proxy_class()[source]
get_super_class()[source]
class glance.notifier.MetadefResourceTypeProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationProxy, glance.domain.proxy.MetadefResourceType

get_super_class()[source]
class glance.notifier.MetadefResourceTypeRepoProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationRepoProxy, glance.domain.proxy.MetadefResourceTypeRepo

add(md_resource_type)[source]
get_payload(obj)[source]
get_proxy_class()[source]
get_super_class()[source]
remove(md_resource_type)[source]
class glance.notifier.MetadefTagFactoryProxy(factory, context, notifier)[source]

Bases: glance.notifier.NotificationFactoryProxy, glance.domain.proxy.MetadefTagFactory

get_proxy_class()[source]
get_super_class()[source]
class glance.notifier.MetadefTagProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationProxy, glance.domain.proxy.MetadefTag

get_super_class()[source]
class glance.notifier.MetadefTagRepoProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationRepoProxy, glance.domain.proxy.MetadefTagRepo

add(metadef_tag)[source]
add_tags(metadef_tags)[source]
get_payload(obj)[source]
get_proxy_class()[source]
get_super_class()[source]
remove(metadef_tag)[source]
save(metadef_tag)[source]
class glance.notifier.NotificationBase[source]

Bases: object

get_payload(obj)[source]
send_notification(notification_id, obj, extra_payload=None)[source]
class glance.notifier.NotificationFactoryProxy(factory, context, notifier)[source]

Bases: object

get_proxy_class()[source]
get_super_class()[source]
class glance.notifier.NotificationProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationBase

get_super_class()[source]
class glance.notifier.NotificationRepoProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationBase

get_proxy_class()[source]
get_super_class()[source]
class glance.notifier.Notifier[source]

Bases: object

Uses a notification strategy to send out messages about events.

error(event_type, payload)[source]
info(event_type, payload)[source]
warn(event_type, payload)[source]
class glance.notifier.TaskFactoryProxy(factory, context, notifier)[source]

Bases: glance.notifier.NotificationFactoryProxy, glance.domain.proxy.TaskFactory

get_proxy_class()[source]
get_super_class()[source]
class glance.notifier.TaskProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationProxy, glance.domain.proxy.Task

begin_processing()[source]
fail(message)[source]
get_payload(obj)[source]
get_super_class()[source]
run(executor)[source]
succeed(result)[source]
class glance.notifier.TaskRepoProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationRepoProxy, glance.domain.proxy.TaskRepo

add(task)[source]
get_payload(obj)[source]
get_proxy_class()[source]
get_super_class()[source]
remove(task)[source]
class glance.notifier.TaskStubProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationProxy, glance.domain.proxy.TaskStub

get_super_class()[source]
class glance.notifier.TaskStubRepoProxy(repo, context, notifier)[source]

Bases: glance.notifier.NotificationRepoProxy, glance.domain.proxy.TaskStubRepo

get_proxy_class()[source]
get_super_class()[source]
glance.notifier.format_image_member_notification(image_member)[source]

Given a glance.domain.ImageMember object, return a dictionary of relevant notification information.

glance.notifier.format_image_notification(image)[source]

Given a glance.domain.Image object, return a dictionary of relevant notification information. We purposely do not include ‘location’ as it may contain credentials.

glance.notifier.format_metadef_namespace_notification(metadef_namespace)[source]
glance.notifier.format_metadef_object_notification(metadef_object)[source]
glance.notifier.format_metadef_property_notification(metadef_property)[source]
glance.notifier.format_metadef_resource_type_notification(metadef_resource_type)[source]
glance.notifier.format_metadef_tag_notification(metadef_tag)[source]
glance.notifier.format_task_notification(task)[source]
glance.notifier.get_transport()[source]
glance.notifier.set_defaults(control_exchange='glance')[source]

glance.opts module

glance.opts.list_api_opts()[source]

Return a list of oslo_config options available in Glance API service.

Each element of the list is a tuple. The first element is the name of the group under which the list of elements in the second element will be registered. A group name of None corresponds to the [DEFAULT] group in config files.

This function is also discoverable via the ‘glance.api’ entry point under the ‘oslo_config.opts’ namespace.

The purpose of this is to allow tools like the Oslo sample config file generator to discover the options exposed to users by Glance.

Returns:a list of (group_name, opts) tuples
glance.opts.list_registry_opts()[source]

Return a list of oslo_config options available in Glance Registry service.

glance.opts.list_scrubber_opts()[source]

Return a list of oslo_config options available in Glance Scrubber service.

glance.opts.list_cache_opts()[source]

Return a list of oslo_config options available in Glance Cache service.

glance.opts.list_manage_opts()[source]

Return a list of oslo_config options available in Glance manage.

glance.opts.list_artifacts_opts()[source]

Return a list of oslo_config options available in Glance artifacts

glance.schema module

class glance.schema.CollectionSchema(name, item_schema)[source]

Bases: object

minimal()[source]
raw()[source]
class glance.schema.DictCollectionSchema(name, item_schema)[source]

Bases: glance.schema.Schema

minimal()[source]
raw()[source]
class glance.schema.PermissiveSchema(name, properties=None, links=None, required=None, definitions=None)[source]

Bases: glance.schema.Schema

minimal()[source]
raw()[source]
class glance.schema.Schema(name, properties=None, links=None, required=None, definitions=None)[source]

Bases: object

filter(obj)[source]
merge_properties(properties)[source]
minimal()[source]
raw()[source]
validate(obj)[source]

glance.scrubber module

class glance.scrubber.Daemon(wakeup_time=300, threads=100)[source]

Bases: object

start(application)[source]
wait()[source]
class glance.scrubber.ScrubDBQueue[source]

Bases: object

Database-based image scrub queue class.

add_location(image_id, location)[source]

Adding image location to scrub queue.

Parameters:
  • image_id – The opaque image identifier
  • location – The opaque image location
Returns:

A boolean value to indicate success or not

get_all_locations()[source]

Returns a list of image id and location tuple from scrub queue.

Returns:a list of image id, location id and uri tuple from scrub queue
has_image(image_id)[source]

Returns whether the queue contains an image or not.

Parameters:image_id – The opaque image identifier
Returns:a boolean value to inform including or not
class glance.scrubber.Scrubber(store_api)[source]

Bases: object

run(event=None)[source]
glance.scrubber.get_scrub_queue()[source]

glance.version module

Module contents