Expand description
POST /api/runs (start a new tune run) and POST /api/runs/{id}/cancel (request its
cancellation) – the write side of the run-history API routes::history reads from.
Reuses bhtune-cli‘s own bhtune_cli::commands::tune::prepare/bhtune_cli::commands::tune::drive
split unchanged, so a run started over HTTP goes through exactly the same template
lookup, tag derivation, driver connection, quality checks, restore-on-abort, and
write-back rollback as a run started by the CLI – only the setup/reporting differs (see
those functions’ own doc comments for the full rationale). crate::active_run tracks
every in-flight run so each can be cancelled independently.
Structs§
- Start
RunRequest - The body of
POST /api/runscontains the per-run tune inputs. Operational timing values are intentionally absent: they are resolved from the global[tuning]configuration byprepare(), just as they are for a CLI invocation. Every field that has a CLI default (--sim-gain, etc.) repeats that exact default here via#[serde(default = "...")], so an HTTP caller that omits a field gets identical behavior to a CLI invocation that omits the matching flag.Option<T>fields need no#[serde(default)]of their own – serde already treats a missing key asNonefor anOptionfield. - Update
Notes Request - The body of
PUT /api/runs/{id}/notes. - Write
RunRequest - The body of
POST /api/runs/{id}/write.