-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathget_status.py
More file actions
51 lines (42 loc) · 1.74 KB
/
get_status.py
File metadata and controls
51 lines (42 loc) · 1.74 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
import requests
import json
from time import sleep
from datasources import ds_csv_1
result = requests.post('http://localhost:8080/simjoin/api/addsource',
data=json.dumps(ds_csv_1),
headers={'Content-Type':'application/json',
'accept': 'application/json'})
print(result.json())
api_key = result.headers['id']
ds_id = result.json()[0]['id']
join_json = {
"limit": 50,
"params": {
"input_dataSource": ds_id,
"join_type": "knn",
"k": 2,
"max_lines": 100,
"threshold": 0
}
}
result = requests.post('http://localhost:8080/simjoin/api/startjoin',
data=json.dumps(join_json),
headers={'Content-Type':'application/json',
'accept': 'application/json',
'api_key': api_key})
print(result.json())
job_id = result.json()['id']
get_json = { 'id': job_id}
result = requests.post('http://localhost:8080/simjoin/api/getstatus',
data=json.dumps(get_json),
headers={'Content-Type':'application/json',
'accept': 'application/json',
'api_key': api_key})
print(result.json())
sleep(3)
result = requests.post('http://localhost:8080/simjoin/api/getstatus',
data=json.dumps(get_json),
headers={'Content-Type':'application/json',
'accept': 'application/json',
'api_key': api_key})
print(result.json())