diff --git a/examples/querying.py b/examples/querying.py index 1c4e223..458ad83 100644 --- a/examples/querying.py +++ b/examples/querying.py @@ -9,10 +9,10 @@ api_key = "buyer_key" # get this from the fortress web dashboard -ip_addr = "127.0.0.1" +ip_addr = "test-enclave.fortressenclaves-dev.com" # Initialize a buyer instance -buyer = Buyer(api_key, ip_addr) +buyer = Buyer(api_key, ip_addr, use_https=True) # Initiate a query diff --git a/fortress_sdk/fortress_sdk.py b/fortress_sdk/fortress_sdk.py index b46ddd4..522f16c 100644 --- a/fortress_sdk/fortress_sdk.py +++ b/fortress_sdk/fortress_sdk.py @@ -169,3 +169,20 @@ def print_query_history(self): a=query["accuracy"][44:], ) print(query_string) + + def check_ping(self): + """ + Return ping status for the enclave + + :return: status of the enclave + :rtype: bool + """ + ping_url = f"{self.url}/health" + + r = requests.get(ping_url) + rsp = r.json() + + if rsp["status"] == "ok": + return True + else: + return False