import requests


def system_check(gc):
    """Check DSA connection with the girder client

    Args:
        gc: girder client
    Returns:
        int: 0 for successful connection, 1 otherwise
    """

    try:
        _ = gc.get("/system/check")

    except requests.exceptions.HTTPError as err:

        print(f"Please check your host or credentials")
        print(err)
        return 1

    print("Successfully connected to DSA")

    return 0