ooiservices/app/main/notifications_redmine.py
def begin_notification(alert_alarm, alert_alarm_definition, user_event_notification):
    """
    Initiate the notification/escalation process for an alert or an alarm.
    Process:
    - Get alert_alarm
    - Get alert_alarm_definition
    - Get user_event_notification information
    * Create initial notification
    - if successful, then:
        alert_alarm.escalated =True;
        alert_alarms_escalated = dt.datetime.strftime(dt.datetime.now(), "%Y-%m-%dT%H:%M:%S")
        alert_alarm.ticket_id = ticket_id (id from redmine or zero (0) otherwise)
        persist escalation field changes with update_alert_alarm
    """
    result = None
    try:
        ticket_id = 0

        # If red mine enabled:
        if user_event_notification.use_redmine:
            ticket_id = begin_notification_redmine(alert_alarm, alert_alarm_definition, user_event_notification)

        # Update escalate fields.
        if ticket_id is not None:
            escalated = True
            ts_escalated = dt.datetime.strftime(dt.datetime.now(), "%Y-%m-%dT%H:%M:%S")
            SystemEvent.update_alert_alarm_escalation(id=alert_alarm.id, ticket_id=ticket_id,
                                                      escalated=escalated, ts_escalated=ts_escalated)
        return ticket_id

    except Exception as err:
        current_app.logger.info('[begin_notification] %s ' % err.message)
        return result

    Initiate the notification/escalation process for an alert or an alarm.
    Process:
    - Get alert_alarm
    - Get alert_alarm_definition
    - Get user_event_notification information
    * Create initial notification
    - if successful, then:
        alert_alarm.escalated =True;
        alert_alarms_escalated = dt.datetime.strftime(dt.datetime.now(), "%Y-%m-%dT%H:%M:%S")
        alert_alarm.ticket_id = ticket_id (id from redmine or zero (0) otherwise)
        persist escalation field changes with update_alert_alarm
    
Initiate the notification/escalation process for an alert or an alarm.
Initiate the notification / escalation process for an alert or an alarm .
def begin_notification(alert_alarm, alert_alarm_definition, user_event_notification):
    result = None
    try:
        ticket_id = 0
        if user_event_notification.use_redmine:
            ticket_id = begin_notification_redmine(alert_alarm, alert_alarm_definition, user_event_notification)
        if ticket_id is not None:
            escalated = True
            ts_escalated = dt.datetime.strftime(dt.datetime.now(), "%Y-%m-%dT%H:%M:%S")
            SystemEvent.update_alert_alarm_escalation(id=alert_alarm.id, ticket_id=ticket_id,
                                                      escalated=escalated, ts_escalated=ts_escalated)
        return ticket_id
    except Exception as err:
        current_app.logger.info('[begin_notification] %s ' % err.message)
        return result
def begin_notification ( alert_alarm , alert_alarm_definition , user_event_notification ) : result = None try : ticket_id = 0 if user_event_notification . use_redmine : ticket_id = begin_notification_redmine ( alert_alarm , alert_alarm_definition , user_event_notification ) if ticket_id is not None : escalated = True ts_escalated = dt . datetime . strftime ( dt . datetime . now ( ) , "%Y-%m-%dT%H:%M:%S" ) SystemEvent . update_alert_alarm_escalation ( id = alert_alarm . id , ticket_id = ticket_id , escalated = escalated , ts_escalated = ts_escalated ) return ticket_id except Exception as err : current_app . logger . info ( '[begin_notification] %s ' % err . message ) return result
Initiate the notification/escalation process for an alert or an alarm.
Initiate the notification / escalation process for an alert or an alarm .
"""
    Initiate the notification/escalation process for an alert or an alarm.
    Process:
    - Get alert_alarm
    - Get alert_alarm_definition
    - Get user_event_notification information
    * Create initial notification
    - if successful, then:
        alert_alarm.escalated =True;
        alert_alarms_escalated = dt.datetime.strftime(dt.datetime.now(), "%Y-%m-%dT%H:%M:%S")
        alert_alarm.ticket_id = ticket_id (id from redmine or zero (0) otherwise)
        persist escalation field changes with update_alert_alarm
    """ # If red mine enabled: # Update escalate fields.
alert_alarm
alert_alarm_definition
user_event_notification