Example #1
0
 def event_log_delete(self, id):
     with _session_for_write() as session:
         query = model_query(models.EventLog, session=session)
         query = query.filter_by(id=id)
         try:
             query.one()
         except NoResultFound:
             raise exceptions.EventLogNotFound(eventLog=id)
         query.delete()
Example #2
0
    def event_log_get(self, uuid):
        query = model_query(models.EventLog)

        if uuid:
            query = query.filter_by(uuid=uuid)

        query = add_event_log_filter_by_event_suppression(
            query, include_suppress=True)

        try:
            result = query.one()
        except NoResultFound:
            raise exceptions.EventLogNotFound(eventLog=uuid)

        return result