I need to automate the control of GeoEvent inputs (enable/start and disable/stop) through a Python script instead of manually managing them from GeoEvent Manager. Could you please help me out.
here is code snippet
def start_geoevent_input(token):
# GeoEvent Admin API endpoint for starting a specific service/connector
api_url = f"{GEOEVENT_URL}/geoevent/rest/inputs/{INPUT_NAME}/start"
headers = {
'Accept': 'application/json',
'Authorization': f'Bearer {token}'
}
# Send empty POST request to trigger the start action
response = requests.post(api_url, headers=headers, verify=False)
if response.status_code == 200:
print(f"Successfully sent start command to input: '{INPUT_NAME}'")
print(f"Response: {response.json()}")
else:
print(f"Failed to start input. Status code: {response.status_code}")
print(f"Error: {response.text}")