Migration Toolkit Docs

Section 02

Function Catalog

Every function in the toolkit, grouped by module. The core modules carry the migration logic; the GUI and threading helpers keep the desktop app responsive.

core/models.py

AP model catalog & AOS-10 image mapping

  • _register()

    Register a list of models into the built-in catalog under a hardware family.

  • normalize_model()

    Normalize controller model strings (515, AP515, AP-515) to canonical form.

  • get_model_info()

    Resolve a model → APModelInfo (family, AOS-10 capability), inferring unknown SKUs without crashing.

  • _guess_family()

    Infer Wi-Fi 5/6/6E/7 family from the numeric model range when not in catalog.

  • all_models()

    Return the full sorted catalog (used by the Settings reference view).

core/ap_inventory.py

Parse AP database → structured records

  • AccessPoint.enrich()

    Attach model-derived facts: family, AOS-10 capability, target image.

  • AccessPoint.is_up / family_label

    Convenience properties for status gating and display.

  • parse_ap_database()

    Main parser: locate header, map columns, build AccessPoint rows; tolerant of column drift & bad rows.

  • _find_header()

    Locate the header line (Name … AP Type) in raw CLI output.

  • _row_to_ap()

    Map one split data row to an AccessPoint, with positional fallback for IP/MAC.

  • _parse_loose()

    Permissive whitespace parse when no recognizable header is present.

  • group_by_model()

    Group APs by normalized model — drives batch-by-model processing.

  • group_by_family()

    Group APs by hardware family for reporting/summary counts.

core/connection.py

SSH transport + simulation backend

  • ControllerConnection.*

    Common interface: connect/disconnect/send_command/send_config + context manager.

  • NetmikoConnection.connect()

    Production: lazy-import Netmiko, open SSH to the ArubaOS controller, optional enable.

  • NetmikoConnection.send_command / send_config

    Run show/config commands over the live SSH session.

  • SimulatedConnection.send_command()

    Return canned show ap database / image-status output (offline testing).

  • SimulatedConnection.send_config()

    Fake ap convert responses and track converted APs in memory.

  • ConnectionProfile.redacted()

    Safe dict of the profile with secrets masked for logging.

  • build_connection()

    Factory — returns Simulated or Netmiko backend based on the simulate flag.

core/convert.py

The MM/MD 'ap convert' workflow

  • build_convert_commands()

    Build the controller CLI for one AP — ap convert add-ap <name|serial>, Central-pull or staged-image variant.

  • precheck_ap()

    Safety gate: return a reason the AP must NOT convert (not AOS-10 capable, down, no target) or None.

  • convert_ap()

    Enforce gates, issue convert command(s), classify outcome (SUCCESS / FAILED / SKIPPED). Honors dry-run.

core/upgrade.py

Orchestration engine — the heart

  • UpgradeEngine.run()

    Public entry: build report, dispatch to the chosen strategy, emit final summary.

  • _run_batch_by_model()

    Strategy 1: group by model; convert/verify one model group at a time; optional halt-on-group-failure.

  • _run_dynamic_per_ap()

    Strategy 2: loop the list, re-resolve model facts per AP at runtime, process each independently.

  • _process_single()

    The shared per-AP state machine: PRECHECK → CONVERTING → UPGRADING → REBOOTING → VERIFYING → DONE/FAILED/SKIPPED.

  • _verify()

    Confirm AOS-10 via Central (retried), fallback to controller image status in sim/no-Central runs.

  • _set_state() / _log() / _emit()

    Emit EngineEvents (ap_state / log / progress / done) to the GUI callback.

  • _interruptible_wait()

    Sliced sleep so Cancel is responsive during image-load/reboot waits.

  • cancel() / _tally()

    Cooperative cancellation flag; tally done/failed/skipped into the RunReport.

  • RunReport.as_rows()

    Flatten results to dict rows for CSV export & the runner table.

core/central_api.py

Aruba Central REST (cloud verification)

  • CentralClient._get()

    HTTP GET with bearer token (or simulation dispatch).

  • verify_firmware_available()

    Confirm the target AOS-10 version is listed/recommended in Central.

  • device_present_on_aos10()

    Check whether a converted AP (by serial) has surfaced in Central on a 10.x build.

  • _simulated()

    Stateful offline responses — 'not present' pre-convert, 'present on 10.x' post-convert.

core/settings.py · gui/workers.py · gui/state.py

Config, threading, shared state

  • app_root() / data_dir() / config_dir()

    Path resolution that also works inside a PyInstaller one-file bundle.

  • load_image_map()

    Load editable family→image map + model overrides + target version.

  • AppSettings.load() / save()

    Persist non-secret settings to config/settings.json.

  • export_report_csv()

    Write the migration run report to CSV for change records/audit.

  • WorkerBus.post() / drain()

    Thread-safe message queue; drained on the GUI after() tick.

  • run_in_thread()

    Run blocking work on a daemon thread; post result/exception back to the bus.

  • AppContext.add/remove/clear_convert_list()

    Manage the curated convert list shared across views.

  • AppContext.make_connection() / make_central()

    Build the right backends from current settings + session credentials.