32 lines
797 B
Python
32 lines
797 B
Python
import sys
|
|
import time
|
|
|
|
import requests
|
|
|
|
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)
|