Read now works, and terraform directory contains example code

This commit is contained in:
Joachim Friberg committed 2026-08-25 18:58:03 +02:00
1 parent ef498e4a72
commit a6f1019175
43 files changed
+4341 -38

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
import json
import switch_client
import todo
from extractors.xe_page import fetch_tables
PATH = "/dual_image_status.html"
def get_dual_image_status(session) -> list[dict]:
"""Returns one dict per unit (Active image, Next-Active image).
Note: the page also has a "Dual Image Descriptions" table (per-image
version/description) that uses a header shape (TD.tableHeaderright +
plain TD.defright rows, no defleft labels) our generic scalar/tabular
parser doesn't handle -- skipped for now, not needed for this data."""
tables = fetch_tables(session, PATH)
return tables["Dual Image Status"]["rows"]
if __name__ == "__main__":
session = switch_client.get_session()
print(json.dumps(get_dual_image_status(session), indent=2))
todo.mark_implemented(switch_client.BASE_URL + PATH)