neutron_lib.context module¶
Context: context for security/db session.
-
class
neutron_lib.context.
Context
(*args, **kwargs)¶ Bases:
neutron_lib.context.ContextBaseWithSession
-
clear_transaction_constraint
()¶
-
get_transaction_constraint
()¶
-
property
session
¶
-
set_transaction_constraint
(resource, resource_id, rev_number)¶ Set a revision constraint to enforce before resource_id is changed.
- Parameters
resource – Collection name of resource (e.g. ports or networks)
resource_id – The primary key ID of the individual resource that should have its revision number matched before allowing the transaction to proceed.
rev_number – The revision_number that the resource should be at.
-
-
class
neutron_lib.context.
ContextBase
(user_id=None, tenant_id=None, is_admin=None, timestamp=None, tenant_name=None, user_name=None, is_advsvc=None, **kwargs)¶ Bases:
oslo_context.context.RequestContext
Security context and request information.
Represents the user taking a given action within the system.
-
elevated
()¶ Return a version of this context with admin flag set.
-
classmethod
from_dict
(values)¶ Construct a context object from a provided dictionary.
-
property
is_advsvc
¶
-
property
is_service_role
¶
-
property
tenant_id
¶
-
property
tenant_name
¶
-
to_dict
()¶ Return a dictionary of context attributes.
-
to_policy_values
()¶ A dictionary of context attributes to enforce policy with.
oslo.policy enforcement requires a dictionary of attributes representing the current logged in user on which it applies policy enforcement. This dictionary defines a standard list of attributes that should be available for enforcement across services.
It is expected that services will often have to override this method with either deprecated values or additional attributes used by that service specific policy.
-
-
class
neutron_lib.context.
ContextBaseWithSession
(user_id=None, tenant_id=None, is_admin=None, timestamp=None, tenant_name=None, user_name=None, is_advsvc=None, **kwargs)¶ Bases:
neutron_lib.context.ContextBase
-
property
connection
¶
-
property
session
¶
-
property
transaction
¶
-
property
transaction_ctx
¶
-
property
-
neutron_lib.context.
get_admin_context
()¶
-
neutron_lib.context.
get_admin_context_without_session
()¶