import requests


def list_servers(active=True):
    """Gets list of (active) servers from bootstrap network"""
    params = {'active': 1} if active else {}
    servers_response = requests.get('https://bootstrap.fetch.ai/networks/', params=params)
    if servers_response.status_code != 200:
        raise requests.ConnectionError('Failed to get network status from bootstrap')

    return servers_response.json()