Initial commit

This commit is contained in:
2021-12-30 15:34:27 +00:00
commit 54c75ff97b
18 changed files with 1843 additions and 0 deletions

30
test-prod.py Normal file
View File

@@ -0,0 +1,30 @@
import requests
import time
import sys
session = requests.Session()
session.headers.update({"X-Api-key": "fbdhjsbf43443refdsafa"})
query = {
"type": "sha256",
"filename": "/home/motus/motus_remote/test-file",
"hash": "09a84f6b3a31262465db839ce53f0eaeedc5f4f2615168fac87416af769a4501",
}
response = session.get("http://127.0.0.1:8080/check", params=query)
if response.status_code != 200:
print("Job Submission failed")
print(response.json())
sys.exit(-1)
jobid = response.json()["jobid"]
print("JobID = {}".format(jobid))
query = {"jobid": jobid}
while True:
response = session.get("http://127.0.0.1:8080/status", params=query)
result = response.json()["status"]["status"]
print(result)
if result[0:10] != "Processing":
break
time.sleep(1)