-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_abort_exposure.py
More file actions
executable file
·24 lines (22 loc) · 1.08 KB
/
test_abort_exposure.py
File metadata and controls
executable file
·24 lines (22 loc) · 1.08 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
#!/usr/bin/python3
# Importing required packages
import argparse
import requests
import json
# command line arguments
parser = argparse.ArgumentParser(prog='test_abort_exposure.py',
description='Abort/stop an already running exposure by sending a request to the API server.')
parser.add_argument('-i', '--ip_address', type=str, default='150.204.240.129', help='The IP address the server is running on.')
parser.add_argument('-p', '--port_number', type=int, default=5100, help='The port number the server is running on.')
args = parser.parse_args()
# Composing a payload for API
#payload = {'filename' : str(args.filename), 'exposure_time' : args.exposure_time }
# Defining content type for our payload
#headers = {'Content-type': 'application/json'}
# Compose the API endpoint URL
urlname = "http://" + str(args.ip_address) + ":" + str(args.port_number) + "/abortExposure"
print ("Invoking end-point: ", urlname, ".")
# Sending a post request to the server (API) and receiving a reply
response = requests.post(url=urlname)
# Printing out the response of API
print(response.text)