Update core scanner, parser, SSH client, and UI
This commit is contained in:
@@ -64,6 +64,20 @@ def api_scan():
|
||||
return jsonify({"status": "started", "dept": None})
|
||||
|
||||
|
||||
@app.route("/api/scan/clear", methods=["POST"])
|
||||
def api_scan_clear():
|
||||
"""Wipe all switch & link data then run a full scan."""
|
||||
if scanner.scan_state["running"]:
|
||||
return jsonify({"error": "Scan already running"}), 409
|
||||
conn = db.get_conn()
|
||||
conn.execute("DELETE FROM switches")
|
||||
conn.execute("DELETE FROM links")
|
||||
conn.commit()
|
||||
conn.close()
|
||||
_trigger_scan_background(dept=None)
|
||||
return jsonify({"status": "started", "cleared": True})
|
||||
|
||||
|
||||
@app.route("/api/scan/elec", methods=["POST"])
|
||||
def api_scan_elec():
|
||||
"""Scan only ELEC department switches."""
|
||||
@@ -116,6 +130,8 @@ def api_topology():
|
||||
"hostname": sw.get("hostname", ""),
|
||||
"mgmt_ip": sw.get("mgmt_ip", ""),
|
||||
"description": sw.get("description", ""),
|
||||
"firmware": sw.get("firmware", ""),
|
||||
"vendor": sw.get("vendor", ""),
|
||||
"chassis_id": chassis_id,
|
||||
"last_seen": sw.get("last_seen", ""),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user