Beispiel #1
0
    def create_alert_settings(self, settings, default):
        alert = {
            'webhook_url':
            settings.pop('webhook_url', self.__webhook_url),
            'username':
            settings.pop('username', default['username']),
            'avatar_url':
            settings.pop('avatar_url', default['avatar_url']),
            'disable_embed':
            parse_boolean(settings.pop('disable_embed', self.__disable_embed)),
            'content':
            settings.pop('content', default['content']),
            'icon_url':
            settings.pop('icon_url', default['icon_url']),
            'title':
            settings.pop('title', default['title']),
            'url':
            settings.pop('url', default['url']),
            'body':
            settings.pop('body', default['body']),
            'map':
            get_static_map_url(settings.pop('map', self.__map),
                               self.__static_map_key)
        }

        reject_leftover_parameters(settings, "'Alert level in Discord alarm.")
        return alert
Beispiel #2
0
 def create_alert_settings(self, settings, default):
     alert = {
         'channel': settings.pop('channel', self.__default_channel),
         'username': settings.pop('username', default['username']),
         'icon_url': settings.pop('icon_url', default['icon_url']),
         'title': settings.pop('title', default['title']),
         'url': settings.pop('url', default['url']),
         'body': settings.pop('body', default['body']),
         'map': get_static_map_url(
             settings.pop('map', self.__map), self.__static_map_key)
     }
     reject_leftover_parameters(settings, "'Alert level in Slack alarm.")
     return alert
Beispiel #3
0
 def create_alert_settings(self, settings, default):
     map = settings.pop('map', self.__map)
     alert = {
         'channel': settings.pop('channel', self.__default_channel),
         'username': settings.pop('username', default['username']),
         'icon_url': settings.pop('icon_url', default['icon_url']),
         'title': settings.pop('title', default['title']),
         'url': settings.pop('url', default['url']),
         'body': settings.pop('body', default['body']),
         'map': map if isinstance(map, six.string_types) else
         get_static_map_url(map, self.__static_map_key)
     }
     reject_leftover_parameters(settings, "'Alert level in Slack alarm.")
     return alert
Beispiel #4
0
    def create_alert_settings(self, settings, default):
        alert = {
            'webhook_url': settings.pop('webhook_url', self.__webhook_url),
            'username': settings.pop('username', default['username']),
            'avatar_url': settings.pop('avatar_url', default['avatar_url']),
            'disable_embed': parse_boolean(
                settings.pop('disable_embed', self.__disable_embed)),
            'content': settings.pop('content', default['content']),
            'icon_url': settings.pop('icon_url', default['icon_url']),
            'title': settings.pop('title', default['title']),
            'url': settings.pop('url', default['url']),
            'body': settings.pop('body', default['body']),
            'map': get_static_map_url(
                settings.pop('map', self.__map), self.__static_map_key)
        }

        reject_leftover_parameters(settings, "'Alert level in Discord alarm.")
        return alert