Build a relocation archive, and — unless the mode says otherwise — send it and restore it.
const url = 'https://example.com/api/v1/system/relocation';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"auth":{"kind":"password","secret":"example","sudo_password":"example"},"include_images":true,"include_metrics":true,"include_tier2":true,"install_docker":true,"mode":"archive","target":{"dir":"example","host":"example","port":1,"user":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/system/relocation \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "auth": { "kind": "password", "secret": "example", "sudo_password": "example" }, "include_images": true, "include_metrics": true, "include_tier2": true, "install_docker": true, "mode": "archive", "target": { "dir": "example", "host": "example", "port": 1, "user": "example" } }'Hands the request to the privileged updater and returns immediately; the work outlives this
request by minutes. Poll GET for the outcome.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”What the operator asked for.
object
Required for preflight and push. Never stored, never logged, never returned.
object
password or key.
The password, or the OpenSSH private key, depending on kind.
The sudo password, when it differs from the login password. Only ever needed to install Docker on the target.
Carry the three Yagra images. Off by default — the new host usually pulls them. Needed when it cannot reach the registry, or when this deployment runs images from a private one.
Carry the metrics (VictoriaMetrics). On by default — a monitoring system that arrives with no history is a new deployment, not a moved one.
Carry the events and flows (VictoriaLogs, ClickHouse). On by default, and the one option with a running cost: both stores are stopped for the minutes the copy takes.
Install Docker on the target if it has none. On by default; needs sudo and internet
there, and runs the official get.docker.com script as root.
archive builds one and stops, preflight only checks the target, push does everything.
Required for preflight and push.
object
A directory name — not a path — created under that account’s home.
Host name or IP of the new server.
SSH port. 22 unless the site moved it.
The account to log in as. It needs sudo only when Docker has to be installed.
Responses
Section titled “Responses”Accepted; the updater will carry it out
The run id, so the page can tell its own request from one another admin started.
object
Examplegenerated
{ "id": "example"}A malformed target, or a push with no credentials
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}No valid bearer token
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Role lacks ManageSystem, ManageCredentials or ViewAudit
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}A relocation or an upgrade is already running
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}The mechanism is absent, switched off, or too old for this command
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Not enough free disk space to build the archive
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}