Skip to content

Change history and restore

Every change to a shared thing is kept: who made it, when, and what it was before and after. The History page shows them all; a host’s and a scenario’s pages show their own.

  • Hosts: made, changed, started, stopped, deleted, with the name, port, state and configuration before and after.
  • Scenarios: made, changed, deleted, with the name and the file.
  • The data policy: every change, with the policy before and after.
  • Dialects: versions saved and deleted, with the source.
  • API tokens: made and revoked, with the name and prefix (never the token).

A change is kept only when the change itself succeeded: a host change the simulator refused leaves no trace, because nothing changed.

Open History (or the Change history card on a host’s or scenario’s page) and choose Show the difference. A scenario’s change reads as a line diff of the file; a host’s or the policy’s as the fields that differ, with the value before and after. Narrow the page to one kind, or follow All changes from a host or scenario to see only its own.

Restore (editors) puts a host, a scenario or the data policy back to how it was before that change:

  • a host’s name, port, state and configuration are applied by the simulator like any change, and refused if they can’t be (a port taken since);
  • a deleted host or scenario comes back, as long as its name (and a host’s port) is free;
  • the data policy is saved and published to the running hosts again.

The restore is itself a change in the history, noting which change it undid, so it can be undone in turn. Dialect versions can’t be restored (save the source as a new version); a revoked token is made again.

Changes are kept for two years by default; ISO8583SIM_PLATFORM_CHANGE_HISTORY_DAYS sets another retention. Runs are kept for the data policy’s retention, separately.

On Settings, admins can ask that changes to simulated hosts, or to dialects, wait for an admin. With that on, an editor’s change (and an admin’s own) is held as a proposal: the console says so and points at the History page, where Changes awaiting approval lists what is pending with who asked, the difference it would make, and Approve, Reject (with a note for the proposer) and Withdraw. Nothing applies until an admin approves, whether the change came from the console, the CI client or a script: the gate is in the API.

An approved change is applied as the proposer asked, through the same checks as a change made by hand, and lands in the history under the proposer’s name with the approver in the note. A change the checks refuse on approval (a port taken since, a dialect that no longer resolves) is left as failed with the reason. By default another admin must approve a change an admin proposed; Admins may approve their own changes turns that off for an install with one admin.

GET /api/changes lists changes (kind, object_id, before_id and limit narrow and page them); GET /api/changes/{id} gives one with the difference; POST /api/changes/{id}/restore restores it (editors). GET /api/settings/approvals and its PUT (admins) set the approvals; GET /api/proposals lists them (status picks decided ones), GET /api/proposals/{id} gives one with the difference, and POST /api/proposals/{id}/approve, reject (with a note) and withdraw decide them. A gated write answers 202 with {"proposal": ...} instead of the thing changed.