forked from smartdatalake/simjoin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappend_source.py
More file actions
20 lines (16 loc) · 794 Bytes
/
append_source.py
File metadata and controls
20 lines (16 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import requests
import json
from datasources import ds_csv_1, ds_jdbc
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']
print('Private API key is {}'.format(api_key))
result = requests.post('http://localhost:8080/simjoin/api/appendsource',
data=json.dumps(ds_jdbc),
headers={'Content-Type':'application/json',
'accept': 'application/json',
'api_key': api_key})
print(result.json())