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

+20
View File
@@ -0,0 +1,20 @@
import json
import switch_client
import todo
from extractors.xe_page import fetch_tables
PATH = "/LoopProtectionStatus.html"
def get_loop_protection_status(session) -> list[dict]:
"""Returns one dict per port (Interface, Configured Action Taken,
Protection Feature Mode, Tx Mode, counters, Loop Detected)."""
tables = fetch_tables(session, PATH)
return tables["Loop Protection Status"]["rows"]
if __name__ == "__main__":
session = switch_client.get_session()
print(json.dumps(get_loop_protection_status(session), indent=2))
todo.mark_implemented(switch_client.BASE_URL + PATH)