Skip to content
Snippets Groups Projects
api.py 441 B
Newer Older
import logging
logger = logging.getLogger(__name__)


def fetch_services(host):
    """
    Fetches the current service state from the Reporting Provider host
    """
    try:
        r = requests.get(f'{host}/scid/current')
        r.raise_for_status()
        services = r.json()
    except requests.exceptions.HTTPError:
        logger.exception('Error when fetching services:')
        services = []