You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
451 B

#!/usr/bin/env python3
import urllib.request
import json
# Test source status
req = urllib.request.Request(
'http://localhost:8080/v1/admin/source/status',
headers={'X-API-Key': 'demo-api-key-2024'}
)
try:
response = urllib.request.urlopen(req, timeout=10)
data = json.loads(response.read().decode())
print('Source Status:')
print(json.dumps(data, indent=2, ensure_ascii=False))
except Exception as e:
print('Error:', e)