The nova.notifications
Module¶
Functionality related to notifications common to multiple layers of the system.
-
audit_period_bounds
(current_period=False)¶ Get the start and end of the relevant audit usage period
Parameters: current_period – if True, this will generate a usage for the current usage period; if False, this will generate a usage for the previous audit period.
-
bandwidth_usage
(instance_ref, audit_start, ignore_missing_network_data=True)¶ Get bandwidth usage information for the instance for the specified audit period.
-
image_meta
(system_metadata)¶ Format image metadata for use in notifications from the instance system metadata.
-
info_from_instance
(context, instance, network_info, system_metadata, **kw)¶ Get detailed instance information for an instance which is common to all notifications.
:param:instance: nova.objects.Instance :param:network_info: network_info provided if not None :param:system_metadata: system_metadata DB entries for the instance, if not None
Note
Currently unused here in trunk, but needed for potential custom modifications.
-
notify_decorator
(name, fn)¶ Decorator for notify which is used from utils.monkey_patch().
Parameters: - name – name of the function
- fn –
- object of the function
Returns: fn – decorated function
-
send_api_fault
(url, status, exception)¶ Send an api.fault notification.
-
send_update
(context, old_instance, new_instance, service='compute', host=None)¶ Send compute.instance.update notification to report any changes occurred in that instance
-
send_update_with_states
(context, instance, old_vm_state, new_vm_state, old_task_state, new_task_state, service='compute', host=None, verify_states=False)¶ Send compute.instance.update notification to report changes if there are any, in the instance