-
-
Notifications
You must be signed in to change notification settings - Fork 466
Expand file tree
/
Copy pathtest.py
More file actions
60 lines (51 loc) · 1.48 KB
/
Copy pathtest.py
File metadata and controls
60 lines (51 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Done once for the whole docs
import requests, json
api_root = 'http://localhost:5555/api'
task_api = '{}/task'.format(api_root)
args = {'args': ["image/Mike_Alden_0001.png", 1, 2]}
#url = '{}/async-apply/upload_api-v2.detect'.format(task_api)
url = '{}/apply/upload_api-v2.detect'.format(task_api)
print(url)
resp = requests.post(url, data=json.dumps(args))
reply = resp.json()
print reply
url = '{}/queues/length'.format(api_root)
print(url)
resp = requests.get(url)
print 'Queues length is {}'.format(resp.json())
args = {'args': ["image/Mike_Alden_0001_0.png"]}
url = '{}/apply/upload_api-v2.extract'.format(task_api)
print(url)
resp = requests.post(url, data=json.dumps(args))
reply = resp.json()
print reply
url = '{}/queues/length'.format(api_root)
print(url)
resp = requests.get(url)
print 'Queues length is {}'.format(resp.json())
### Get list
#url = '{}/tasks'.format(api_root)
#print(url)
#payload = {'state': 'STARTED','taskname':'tasks.detect'}
#resp = requests.get(url,params=payload)
#print 'task running is {}'.format(resp.json())
#
#
#print 'Test block call'
#url = '{}/apply/tasks.detect'.format(task_api)
#print(url)
#resp = requests.post(url, data=json.dumps(args))
#reply = resp.json()
#print reply
#
#
#url = '{}/queues/length'.format(api_root)
#print(url)
#resp = requests.get(url)
#print 'Queues length is {}'.format(resp.json())
#
#url = '{}/apply/tasks.fullimage'.format(task_api)
#print(url)
#resp = requests.post(url, data=json.dumps(args))
#reply = resp.json()
#print reply