import requests
import logging

from raava import worker


##### Private objects #####
_logger = logging.getLogger(__name__)


##### Public methods #####
def send_raw(to, host, service, status, description, instance=""):
    _logger.debug("Sending to Juggler: %s", to)
    ok = False
    try:
        result = requests.get("http://{}/juggler-fcgi.py".format(to), params={
                "host":        host,
                "service":     service,
                "instance":    instance,
                "status":      status,
                "description": description,
            })
        if result.status_code == 200 and result.text == "OK":
            _logger.info("Event sent to Juggler to %s, response: %s", to, result)
            ok = True
        else:
            _logger.error("Failed to send SMS to %s: %d %s; %s", to, result.status_code, result.reason, result.text)
    except Exception:
        _logger.exception("Failed to send SMS to %s", to)
    worker.get_current_task().checkpoint()
    return ok

814840e6b79676b31c0e9521aa881d12555be2d5
<mask token>

<mask token>


def send_raw(to, host, service, status, description, instance=''):
    _logger.debug('Sending to Juggler: %s', to)
    ok = False
    try:
        result = requests.get('http://{}/juggler-fcgi.py'.format(to),
            params={'host': host, 'service': service, 'instance': instance,
            'status': status, 'description': description})
        if result.status_code == 200 and result.text == 'OK':
            _logger.info('Event sent to Juggler to %s, response: %s', to,
                result)
            ok = True
        else:
            _logger.error('Failed to send SMS to %s: %d %s; %s', to, result
                .status_code, result.reason, result.text)
    except Exception:
        _logger.exception('Failed to send SMS to %s', to)
    worker.get_current_task().checkpoint()
    return ok

<mask token>
_logger = logging.getLogger(__name__)


def send_raw(to, host, service, status, description, instance=''):
    _logger.debug('Sending to Juggler: %s', to)
    ok = False
    try:
        result = requests.get('http://{}/juggler-fcgi.py'.format(to),
            params={'host': host, 'service': service, 'instance': instance,
            'status': status, 'description': description})
        if result.status_code == 200 and result.text == 'OK':
            _logger.info('Event sent to Juggler to %s, response: %s', to,
                result)
            ok = True
        else:
            _logger.error('Failed to send SMS to %s: %d %s; %s', to, result
                .status_code, result.reason, result.text)
    except Exception:
        _logger.exception('Failed to send SMS to %s', to)
    worker.get_current_task().checkpoint()
    return ok

import requests
import logging
from raava import worker
_logger = logging.getLogger(__name__)


def send_raw(to, host, service, status, description, instance=''):
    _logger.debug('Sending to Juggler: %s', to)
    ok = False
    try:
        result = requests.get('http://{}/juggler-fcgi.py'.format(to),
            params={'host': host, 'service': service, 'instance': instance,
            'status': status, 'description': description})
        if result.status_code == 200 and result.text == 'OK':
            _logger.info('Event sent to Juggler to %s, response: %s', to,
                result)
            ok = True
        else:
            _logger.error('Failed to send SMS to %s: %d %s; %s', to, result
                .status_code, result.reason, result.text)
    except Exception:
        _logger.exception('Failed to send SMS to %s', to)
    worker.get_current_task().checkpoint()
    return ok

import requests
import logging

from raava import worker


##### Private objects #####
_logger = logging.getLogger(__name__)


##### Public methods #####
def send_raw(to, host, service, status, description, instance=""):
    _logger.debug("Sending to Juggler: %s", to)
    ok = False
    try:
        result = requests.get("http://{}/juggler-fcgi.py".format(to), params={
                "host":        host,
                "service":     service,
                "instance":    instance,
                "status":      status,
                "description": description,
            })
        if result.status_code == 200 and result.text == "OK":
            _logger.info("Event sent to Juggler to %s, response: %s", to, result)
            ok = True
        else:
            _logger.error("Failed to send SMS to %s: %d %s; %s", to, result.status_code, result.reason, result.text)
    except Exception:
        _logger.exception("Failed to send SMS to %s", to)
    worker.get_current_task().checkpoint()
    return ok
