def info(self, ctxt, publisher_id, event_type, payload, metadata): """Convert message to Ceilometer Event. :param ctxt: oslo.messaging context :param publisher_id: publisher of the notification :param event_type: type of notification :param payload: notification payload :param metadata: metadata about the notification """ # NOTE: the rpc layer currently rips out the notification # delivery_info, which is critical to determining the # source of the notification. This will have to get added back later. notification = messaging.convert_to_old_notification_format( 'info', ctxt, publisher_id, event_type, payload, metadata) self.process_notification(notification)
def info(self, ctxt, publisher_id, event_type, payload, metadata): """RPC endpoint for notification messages When another service sends a notification over the message bus, this method receives it. :param ctxt: oslo.messaging context :param publisher_id: publisher of the notification :param event_type: type of notification :param payload: notification payload :param metadata: metadata about the notification """ notification = messaging.convert_to_old_notification_format( 'info', ctxt, publisher_id, event_type, payload, metadata) self.to_samples_and_publish(context.get_admin_context(), notification)
def error(self, ctxt, publisher_id, event_type, payload, metadata): """Convert message to Eayunstack Notifier Event. :param ctxt: oslo.messaging context :param publisher_id: publisher of the notification :param event_type: type of notification :param payload: notification payload :param metadata: metadata about the notification """ notification = messaging.convert_to_old_notification_format( 'error', ctxt, publisher_id, event_type, payload, metadata) process_return = self.process_notification(notification) if process_return: return oslo.messaging.NotificationResult.HANDLED else: return oslo.messaging.NotificationResult.REQUEUE