Notifications module for OpenStack Identity Service resources.
keystone.notifications.
ACTIONS
= NotificationActions(created='created', deleted='deleted', disabled='disabled', updated='updated', internal='internal')¶The actions on resources.
keystone.notifications.
Audit
[source]¶Bases: object
Namespace for audit notification functions.
This is a namespace object to contain all of the direct notification
functions utilized for Manager
methods.
added_to
(target_type, target_id, actor_type, actor_id, initiator=None, public=True, reason=None)[source]¶keystone.notifications.
CadfNotificationWrapper
(operation)[source]¶Bases: object
Send CADF event notifications for various methods.
This function is only used for Authentication events. Its action
and
event_type
are dictated below.
authenticate
identity.authenticate
Sends CADF notifications for events such as whether an authentication was successful or not.
Parameters: | operation – The authentication related action being performed |
---|
keystone.notifications.
CadfRoleAssignmentNotificationWrapper
(operation)[source]¶Bases: object
Send CADF notifications for role_assignment
methods.
This function is only used for role assignment events. Its action
and
event_type
are dictated below.
created.role_assignment
or deleted.role_assignment
identity.role_assignment.created
oridentity.role_assignment.deleted
Sends a CADF notification if the wrapped method does not raise an
Exception
(such as keystone.exception.NotFound
).
Parameters: | operation – one of the values from ACTIONS (created or deleted) |
---|
ROLE_ASSIGNMENT
= 'role_assignment'¶keystone.notifications.
clear_subscribers
()[source]¶Empty subscribers dictionary.
This effectively stops notifications since there will be no subscribers to publish to.
keystone.notifications.
emit_event
¶keystone.notifications.
invalidate_token_cache_notification
(reason)[source]¶A specific notification for invalidating the token cache.
Parameters: | reason (string) – The specific reason why the token cache is being invalidated. |
---|
keystone.notifications.
listener
(cls)[source]¶A class decorator to declare a class to be a notification listener.
A notification listener must specify the event(s) it is interested in by
defining a event_callbacks
attribute or property. event_callbacks
is a dictionary where the key is the type of event and the value is a
dictionary containing a mapping of resource types to callback(s).
ACTIONS
contains constants for the currently
supported events. There is currently no single place to find constants for
the resource types.
Example:
@listener
class Something(object):
def __init__(self):
self.event_callbacks = {
notifications.ACTIONS.created: {
'user': self._user_created_callback,
},
notifications.ACTIONS.deleted: {
'project': [
self._project_deleted_callback,
self._do_cleanup,
]
},
}
keystone.notifications.
notify_event_callbacks
(service, resource_type, operation, payload)[source]¶Send a notification to registered extensions.
keystone.notifications.
register_event_callback
(event, resource_type, callbacks)[source]¶Register each callback with the event.
Parameters: |
|
---|---|
Raises: |
|
keystone.notifications.
reset_notifier
()[source]¶Reset the notifications internal state.
This is used only for testing purposes.
keystone.notifications.
role_assignment
¶alias of keystone.notifications.CadfRoleAssignmentNotificationWrapper
keystone.notifications.
send_saml_audit_notification
(action, request, user_id, group_ids, identity_provider, protocol, token_id, outcome)[source]¶Send notification to inform observers about SAML events.
Parameters: |
|
---|
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.