Esempio n. 1
0
 def record_alarm_change(self, alarm_change):
     """Record alarm change event."""
     session = self._engine_facade.get_session()
     with session.begin():
         alarm_change_row = models.AlarmChange(
             event_id=alarm_change['event_id'])
         alarm_change_row.update(alarm_change)
         session.add(alarm_change_row)
Esempio n. 2
0
 def record_alarm_change(self, alarm_change):
     """Record alarm change event.
     """
     session = sqlalchemy_session.get_session()
     with session.begin():
         Connection._create_or_update(session, models.User,
                                      alarm_change['user_id'])
         Connection._create_or_update(session, models.Project,
                                      alarm_change['project_id'])
         Connection._create_or_update(session, models.Project,
                                      alarm_change['on_behalf_of'])
         alarm_change_row = models.AlarmChange(
             event_id=alarm_change['event_id'])
         alarm_change_row.update(alarm_change)
         session.add(alarm_change_row)