Exemple #1
0
def test_cisco_eox_api_access(client_id, client_secret, drop_credentials=True):
    """
    test the Cisco EoX V5 API access
    """
    try:
        base_api = CiscoEoxApi()
        base_api.load_client_credentials()

        if drop_credentials:
            base_api.drop_cached_token()

        base_api.client_id = client_id
        base_api.client_secret = client_secret

        base_api.query_product("WS-C2960-24T")

        return True, ""

    except Exception as ex:
        return False, str(ex)
Exemple #2
0
def test_cisco_eox_api_access(client_id, client_secret, drop_credentials=True):
    """
    test the Cisco EoX V5 API access
    """
    try:
        base_api = CiscoEoxApi()
        base_api.load_client_credentials()

        if drop_credentials:
            base_api.drop_cached_token()

        base_api.client_id = client_id
        base_api.client_secret = client_secret

        base_api.query_product("WS-C2960-24T")

        return True, ""

    except Exception as ex:
        return False, str(ex)
Exemple #3
0
def check_cisco_eox_api_access(client_id,
                               client_secret,
                               drop_credentials=True):
    """
    test the Cisco EoX V5 API access
    """
    try:
        base_api = CiscoEoxApi()
        base_api.load_client_credentials()

        if drop_credentials:
            base_api.drop_cached_token()

        base_api.client_id = client_id
        base_api.client_secret = client_secret

        base_api.query_product("WS-C2960-24T")

        return True

    except Exception as ex:
        logging.error("Cisco EoX API test access failed (%s)" % ex,
                      exc_info=True)
        return False