# glance.context module

class glance.context.RequestContext(service_catalog=None, policy_enforcer=None, **kwargs)

  Bases: `RequestContext`

  Stores information about the security context.

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

  property can_see_deleted

    Admins can see deleted by default

  elevated()

    Return a copy of this context with admin flag set.

  classmethod from_dict(values)

    Construct a context object from a provided dictionary.

  property owner

    Return the owner to correlate with an image.

  to_dict()

    Return a dictionary of context attributes.

glance.context.get_admin_context(show_deleted=False)

  Create an administrator context.

glance.context.get_ksa_client(context)

  Returns a keystoneauth Adapter using token from context.

  This will return a simple keystoneauth adapter that can be used to make requests against a remote service using the token provided (and already authenticated) from the user and stored in a RequestContext.

  Parameters:

    context – User request context

  Returns:

    keystoneauth1 Adapter object

this page last updated: 2026-03-18 20:42:57

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