Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/querying.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions fortress_sdk/fortress_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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