plan, plus
confirmed, the digest of the plan the caller showed, and answers as soon as the work has started.
POST /revisions/:id/data/command (Command: install)
- It plans again, running the checks, in order, and refuses
a plan with a problem, with the first problem’s code. It refuses, too, without
confirmed, or whenconfirmedis not the digest of the plan it has just made. - It moves the record to
installing, creating it on a first install and making it again over anuninstalledrecord. Another operation on it is refused until this one ends. - It creates the accounts the installation lacks and writes the credentials due now (Install and upgrade). When it does either, it needs a person behind the request, which the plan has already checked (Access).
- It answers with the record, and a worker makes and updates the blobs, applies each manifest and runs the migration workflow.
Request Body
Response
Errors
A refusal for one of the plan’s problems takes the first problem’s
code, and its body carries all the plan’s
problems, its lines and its limits. The status is 409 for
alias_in_use, blob_not_ready, installation_busy, migration_running and app_busy, and 400 for the other codes.
app_not_confirmed carries lines and digest, plan_changed the plan and limit_exceeded its limit; any other
refusal, such as forbidden, invalid_request_body, renderer_unavailable or a credential’s invalid_app, carries
only error and message.
A record busy for more than two hours (7200 seconds) is no longer busy, and the reads serve it as failed: the install
ends it failed in the store, with the log line <operation> failed: out of time naming the operation that was
running, and goes on.
Example
The first install of Field Reports 0.2.0 asreports, with its report settings and a weather key, confirming the
digest its plan answered:
blobs fills as the worker makes them. The record
keeps config and never weather_key.
Without confirmation
The same request withoutconfirmed writes nothing and answers the lines it would act on and their digest. Its
message is Confirm the lines this request acts on by sending it again with confirmed: <digest>., with the digest
in place of <digest>. Sent again with "confirmed": "<digest>", it installs, unless the plan has changed meanwhile:
error; message is prose for a person.
When the plan changed
confirmed names one plan. If anything it covers changed between the plan the caller showed and this request, such
as another operation on the record, a newer version left out of the request, an input or a limit’s value, the install
refuses with 409 plan_changed and writes nothing. Its message is
The plan changed since it was confirmed; review it again., and its body is the plan made now, in the whole shape
plan answers: app, from_version, inputs, lines, limits,
deletes, problems and digest. Show it again, and send its digest to install it.
Following the install
The answer isinstalling; the log shows the rest. Read List Log from the
last entry id held before the request, passing next back as after, once a second while
Get Installation answers installing, then once more. The
installation ends ready, or failed with the reason in the log. A failed install is installed again with the same
body and the digest of a new plan: the operation that failed changed the record, so the old digest no longer matches.
