Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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