Ejemplo n.º 1
0
 def save_message(self, component_id, message_code, level, data):
     """
     Save the monitor data.
     :param component_id: The component id - uuid canonical string
     :param message_code: Message type
     :param level The message level.
     :param data: The monitor json data.
     :return: True is successful, False otherwise
     """
     return save_current_status_message(component_id, "system", message_code, data)
Ejemplo n.º 2
0
 def save_message(self, component_id, message_code, level, data):
     """
     Save the monitor data.
     :param component_id: The component id - uuid canonical string
     :param message_code: Message type
     :param level The message level.
     :param data: The monitor json data.
     :return: True is successful, False otherwise
     """
     return save_current_status_message(component_id, 'system', message_code, data)
Ejemplo n.º 3
0
 def trigger_message(self, component_id, component_type, message_code, data=""):
     """
     Creates a current status message and saves it in the database
     :param component_id: The component id - uuid canonical string
     :param message_code: Message type
     :param data: Current Status Message Additional Info
     :return: True is successful, False otherwise
     """
     rt = True
     try:
         rt = save_current_status_message(component_id, component_type, message_code, data)
     except Exception as e:
         rt = False
     return rt
Ejemplo n.º 4
0
 def trigger_message(self, component_id, component_type, message_code, data=""):
     """
     Creates a current status message and saves it in the database
     :param component_id: The component id - uuid cannonical string
     :param message_code: The message id - uuid cannonical string
     :param data: Current Status Message Additional Info
     :return: True is successful, False otherwise
     """
     rt = True
     try:
         rt = save_current_status_message(component_id, component_type, message_code, data)
     except Exception as error:
         logger.error("[trigger_message] %s" % str(error))
         rt = False
     return rt