2025-04-24 18:57:33 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
|
|
import requests
|
|
|
|
|
import json
|
|
|
|
|
import sys
|
|
|
|
|
import base64
|
|
|
|
|
|
|
|
|
|
url = "http://localhost:8088/api/v1/"
|
|
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
|
|
user = "trustgraph"
|
|
|
|
|
|
|
|
|
|
input = {
|
2025-05-04 22:26:19 +01:00
|
|
|
"operation": "list-documents",
|
2025-04-24 18:57:33 +01:00
|
|
|
"user": user,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resp = requests.post(
|
|
|
|
|
f"{url}librarian",
|
|
|
|
|
json=input,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
print(resp.text)
|
|
|
|
|
resp = resp.json()
|
|
|
|
|
|
|
|
|
|
print(resp)
|
|
|
|
|
|
|
|
|
|
if "error" in resp:
|
|
|
|
|
print(f"Error: {resp['error']}")
|
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
|
|
# print(resp["response"])
|
|
|
|
|
print(resp)
|
|
|
|
|
|
|
|
|
|
sys.exit(0)
|
|
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
|
|