Send notification messages.
The Notifier class is used for sending notification messages over a messaging transport or other means.
Notification messages follow the following format:
- {‘message_id’: str(uuid.uuid4()),
- ‘publisher_id’: ‘compute.host1’, ‘timestamp’: timeutils.utcnow(), ‘priority’: ‘WARN’, ‘event_type’: ‘compute.create_instance’, ‘payload’: {‘instance_id’: 12, ... }}
A Notifier object can be instantiated with a transport object and a publisher ID:
notifier = notifier.Notifier(get_transport(CONF), ‘compute.host1’)
and notifications are sent via drivers chosen with the notification_driver config option and on the topics consen with the notification_topics config option.
Alternatively, a Notifier object can be instantiated with a specific driver or topic:
- notifier = notifier.Notifier(RPC_TRANSPORT,
- ‘compute.host’, driver=’messaging’, topic=’notifications’)
Send a notification at critical level.
Parameters: |
|
---|
Send a notification at debug level.
Parameters: |
|
---|
Send a notification at error level.
Parameters: |
|
---|
Send a notification at info level.
Parameters: |
|
---|
Send a notification at warning level.
Parameters: |
|
---|