initial commit
This commit is contained in:
1 parent
af59a90c31
commit
ef498e4a72
114 files changed
+11047
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import json
|
||||
|
||||
import switch_client
|
||||
import todo
|
||||
from extractors.xe_page import fetch_tables
|
||||
|
||||
PATH = "/LLDPStats.html"
|
||||
|
||||
|
||||
def get_lldp_statistics(session) -> dict:
|
||||
"""Returns {"global": record, "interfaces": list[dict]}."""
|
||||
tables = fetch_tables(session, PATH)
|
||||
return {
|
||||
"global": tables["LLDP Global Statistics"]["record"],
|
||||
"interfaces": tables["LLDP Interface Statistics"]["rows"],
|
||||
}
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
session = switch_client.get_session()
|
||||
print(json.dumps(get_lldp_statistics(session), indent=2))
|
||||
todo.mark_implemented(switch_client.BASE_URL + PATH)
|
||||
Reference in new issue
Block a user