-
Notifications
You must be signed in to change notification settings - Fork 0
/
quick_setup.py
executable file
·41 lines (25 loc) · 1.14 KB
/
quick_setup.py
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
#!/usr/bin/env python3.7
import requests
import time
Service_one_name = "service1"
Service_two_name = "app2"
Service_one_address = "127.0.0.1"
Service_one_port = 3000
Service_two_address = "127.0.0.1"
Service_two_port = 4000
Service_one_API_address = "127.0.0.1"
Service_two_API_address = "127.0.0.1"
Service_one_API_port = 9081
Service_two_API_port = 9082
url1 = "http://" + Service_one_address + ":" + str(Service_one_port) + "/form_get_service_name"
data = {'Service_name':Service_one_name, 'API_port': Service_one_API_port, 'API_Address': Service_one_API_address}
r = requests.post(url = url1, data = data)
url1 = "http://" + Service_two_address + ":" + str(Service_two_port) + "/form_get_service_name"
data = {'Service_name':Service_two_name, 'API_port': Service_two_API_port, 'API_Address': Service_two_API_address}
r = requests.post(url = url1, data = data)
time.sleep(0.5)
# now send info to parnter
url2 = "http://" + Service_one_address + ":" + str(Service_one_port) + "/form_send_to_partner"
data = {'port': Service_two_port, 'address': Service_two_address}
r = requests.post(url = url2, data = data)
# can now press sync in the browser