feat: add homelab deployment configs, documentation, and automation scripts
This commit is contained in:
26
scripts/check_homepage_api.py
Normal file
26
scripts/check_homepage_api.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import requests
|
||||
import json
|
||||
import urllib3
|
||||
urllib3.disable_warnings()
|
||||
|
||||
s = requests.Session()
|
||||
r = s.get('https://homepage.snarfnet.net/api/services', verify=False)
|
||||
print("Status /api/services:", r.status_code)
|
||||
try:
|
||||
data = r.json()
|
||||
print("Services JSON keys/length:", len(data))
|
||||
for group in data:
|
||||
for title, items in group.items():
|
||||
print(f"Group: {title}")
|
||||
for item in items:
|
||||
print(f" - {item.get('name')}: widget={item.get('widget')}")
|
||||
except Exception as e:
|
||||
print("Error:", e, r.text[:200])
|
||||
|
||||
r2 = s.get('https://homepage.snarfnet.net/api/widgets', verify=False)
|
||||
print("Status /api/widgets:", r2.status_code)
|
||||
try:
|
||||
print("Widgets:", json.dumps(r2.json(), indent=2))
|
||||
except Exception as e:
|
||||
print("Error widgets:", e, r2.text[:200])
|
||||
|
||||
Reference in New Issue
Block a user