-
Notifications
You must be signed in to change notification settings - Fork 1
/
airmashup.py
39 lines (36 loc) · 1.09 KB
/
airmashup.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
import requests, sys
import time
args = sys.argv[1:]
API_IP = 'http://192.168.1.39:8080'
AIRMASHUP_IP='http://192.168.1.37:8080'
url = '%s/kml/manage/clean' % API_IP
response = requests.get(url,files={'file':''})
def stopPython():
url = "%s/stop" % AIRMASHUP_IP
print(url)
response = requests.get(url)
if(args[0]=='callsign'):
stopPython()
url = "%s/sendAircraftCallsign" % AIRMASHUP_IP
print(url, args[1])
response = requests.post(url,data={'callsign': args[1]}, files={'file':''})
elif(args[0]=='airline'):
stopPython()
url = "%s/sendAircraftCompanies" % AIRMASHUP_IP
print(url)
response = requests.post(url,data={'callsign': args[1]}, files={'file':''})
elif(args[0]=='wing'):
stopPython()
url = "%s/submitWing" % AIRMASHUP_IP
print(url)
response = requests.get(url)
elif(args[0]=='all'):
stopPython()
url = "%s/sendGlobalAircraft" % AIRMASHUP_IP
print(url)
response = requests.get(url)
#
# time.sleep(1)
#
# response = requests.get(url,files={'file':''})
# print("> Answer received by LiquidGalaxy [%s]. "% response.status_code)