How to use the prom2teams.teams.alarm_mapper.TeamsAlarmMapper function in prom2teams

To help you get started, we’ve selected a few prom2teams examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github idealista / prom2teams / prom2teams / web_service / api.py View on Github external
def post(self):
            webhook_url = config['Microsoft Teams']['Connector']
            deprecated_message = "Call to deprecated function. It will be removed in future versions. " \
                                 "Please view the README file."
            show_deprecated_warning(deprecated_message)
            message_schema = MessageSchema()
            alerts = message_schema.load(request.get_json()).data
            alarms = TeamsAlarmMapper.map_prom_alerts_to_teams_alarms(alerts)
            sending_alarms = compose_all(template_path, alarms)
            send_alarms_to_teams(sending_alarms, webhook_url, template_path, logger)
            return 'OK', 201
github idealista / prom2teams / prom2teams / web_service / api.py View on Github external
def post(self, connector):
            webhook_url = config['Microsoft Teams'][connector]
            message_schema = MessageSchema()
            alerts = message_schema.load(request.get_json()).data
            alarms = TeamsAlarmMapper.map_prom_alerts_to_teams_alarms(alerts)
            sending_alarms = compose_all(template_path, alarms)
            send_alarms_to_teams(sending_alarms, webhook_url, template_path, logger)
            return 'OK', 201