# Path: monasca_notification/common/utils.py
# LOG = log.getLogger(__name__)
# CONF = cfg.CONF
# NOTIFICATION_DIMENSIONS = {'service': 'monitoring',
#                            'component': 'monasca-notification'}
# def get_db_repo():
# def construct_notification_object(db_repo, notification_json):
# def grab_stored_notification_method(db_repo, notification_id):
# def get_statsd_client(dimensions=None):
#     def _set_connection(self, connection, host, port):
#     def __init__(self, host='localhost', port=8125, max_buffer_size=50):
#     def connect(self, host, port):
#     def _send_to_server(self, packet):
# def get_keystone_session():
# def get_auth_token():
# class OfflineClient(monascastatsd.Client):
# class OfflineConnection(monascastatsd.Connection):
# 
# Path: monasca_notification/plugins/abstract_notifier.py
# class AbstractNotifier(object, metaclass=abc.ABCMeta):
#     def __init__(self):
#     def statsd_name(self):
#     def config(self, config):
#     def send_notification(self, notification):


import requests
import simplejson as json
from debtcollector import removals
from oslo_config import cfg
from monasca_notification.common import utils
from monasca_notification.plugins import abstract_notifier
        removal_version='3.0.0'
    )
    def config(self, config_dict):
        pass

    @property
    def statsd_name(self):
        return 'sent_webhook_count'

    def send_notification(self, notification):
        """Send the notification via webhook
            Posts on the given url
        """

        body = {'alarm_id': notification.alarm_id,
                'alarm_definition_id': notification.raw_alarm['alarmDefinitionId'],
                'alarm_name': notification.alarm_name,
                'alarm_description': notification.raw_alarm['alarmDescription'],
                'alarm_timestamp': notification.alarm_timestamp,
                'state': notification.state,
                'old_state': notification.raw_alarm['oldState'],
                'message': notification.message,
                'tenant_id': notification.tenant_id,
                'metrics': notification.metrics}

        headers = {'content-type': 'application/json'}

        # Checks if keystone authentication is enabled and adds authentication
        # token to the request headers
        if CONF.keystone.auth_required:

# Path: monasca_notification/common/utils.py
# LOG = log.getLogger(__name__)
# CONF = cfg.CONF
# NOTIFICATION_DIMENSIONS = {'service': 'monitoring',
#                            'component': 'monasca-notification'}
# def get_db_repo():
# def construct_notification_object(db_repo, notification_json):
# def grab_stored_notification_method(db_repo, notification_id):
# def get_statsd_client(dimensions=None):
#     def _set_connection(self, connection, host, port):
#     def __init__(self, host='localhost', port=8125, max_buffer_size=50):
#     def connect(self, host, port):
#     def _send_to_server(self, packet):
# def get_keystone_session():
# def get_auth_token():
# class OfflineClient(monascastatsd.Client):
# class OfflineConnection(monascastatsd.Connection):
# 
# Path: monasca_notification/plugins/abstract_notifier.py
# class AbstractNotifier(object, metaclass=abc.ABCMeta):
#     def __init__(self):
#     def statsd_name(self):
#     def config(self, config):
#     def send_notification(self, notification):


# Path: monasca_notification/plugins/webhook_notifier.py
import requests
import simplejson as json
from debtcollector import removals
from oslo_config import cfg
from monasca_notification.common import utils
from monasca_notification.plugins import abstract_notifier

        removal_version='3.0.0'
    )
    def config(self, config_dict):
        pass

    @property
    def statsd_name(self):
        return 'sent_webhook_count'

    def send_notification(self, notification):
        """Send the notification via webhook
            Posts on the given url
        """

        body = {'alarm_id': notification.alarm_id,
                'alarm_definition_id': notification.raw_alarm['alarmDefinitionId'],
                'alarm_name': notification.alarm_name,
                'alarm_description': notification.raw_alarm['alarmDescription'],
                'alarm_timestamp': notification.alarm_timestamp,
                'state': notification.state,
                'old_state': notification.raw_alarm['oldState'],
                'message': notification.message,
                'tenant_id': notification.tenant_id,
                'metrics': notification.metrics}

        headers = {'content-type': 'application/json'}

        # Checks if keystone authentication is enabled and adds authentication
        # token to the request headers
        if CONF.keystone.auth_required:

            auth_token = utils.get_auth_token()