Skip to content

Restart the engine in its own process (owner only): it applies the settings waiting for a restart and the settings file's edits. With dry_run, it says what a restart would do and whether it can.

POST
/datanotes/restart/
curl --request POST \
--url https://example.com/datanotes/restart/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "dry_run": false }'

The engine checks first that the next start will succeed: the folder exists, the settings file holds a JSON object the engine accepts, with an owner token, and the new port is free. When it would fail, the answer is 409 with the problems, and nothing stops. Otherwise it answers at once, then the requests under way finish and new ones get 503 (the engine is restarting). When a request still runs after 30 s, the restart is cancelled and the engine serves again (last_cancelled). The lock is kept. Poll the dry run until restarting is false: a new started_at then means the restart is done, the same one with last_cancelled that it was cancelled. The new engine answers a moment before it has finished starting, with a new started_at and restarting still true. A new port or owner token applies. A start that still fails ends the process with exit code 1. A named token is refused (403), even with maintain. A host that cannot restart does not serve the route (404).

Media typeapplication/json
object
dry_run

Only say what a restart would do.

boolean

Done.

Media typeapplication/json
object
ok
required

Always true in a 200 answer.

boolean
dry_run
required

Whether this was only a dry run (nothing restarted).

boolean
restarting
required

A restart is under way (always true in the answer of a real restart).

boolean
ready
required

No problem and no restart under way: a restart may start now.

boolean
problems
required

Why the next start would fail, with what to do; empty when nothing would.

Array<object>
object
error
required
string
hint
required
string
docs
required
string
will_apply
required

The settings whose value at the next start differs from what runs now (restart settings changed since the start, hand edits of the file), in settings order. Names only, never values.

Array<string>
still_overridden
required

Settings that differ too, but a start option of datanotes serve keeps winning.

Array<object>
object
setting
required
string
by
required

The start option that wins, in words.

string
warnings
required

“: ” for each setting of will_apply whose rule has a file-only reason or a warning, in settings order.

Array<string>
port
required

The port the engine listens on now.

integer | null
port_after
required

The port after the restart (equal to port unless it changes).

integer
started_at
required

When this run started (ISO; equals /status/ engine.started_at): a new value means the restart is done.

string
pid
required

The engine’s process (a restart does not change it).

integer | null
started_by
required

How the engine was started, as far as it can tell: what decides whether a failed start is started again.

string
Allowed values: systemd container terminal unknown
last_cancelled

The last restart of this run that was cancelled (a request still under way after the drain), with why.

object
requested_at
required
string
reason
required
string
requested_at

Only in the answer of a real restart: when it was asked (ISO).

string

Example

{
"ok": true,
"started_by": "systemd"
}

Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Missing or wrong bearer token.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

A named token beyond its permissions (the engine’s administration, tables outside its write patterns, schema changes without ddl).

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

A restart is already under way, or the next start would fail (problems): nothing stopped.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Unexpected error.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}