import requests import time import json import sys road = int(sys.argv[1]) res = requests.get("http://cloud_computing_project_api:8080/traffic_lights/subscribe?road=" + str(road)) ID = json.loads(res.text)["insertedId"] while True: res = requests.get("http://cloud_computing_project_api:8080/traffic_lights/read?id=" + str(ID)) time.sleep(1)