switch_config_backups
const url = 'https://example.com/api/v1/config-backups/switch';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"enabled":true,"input":"ssh","login_order":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"node_ids":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"]}'};
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/config-backups/switch \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "enabled": true, "input": "ssh", "login_order": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "node_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Many nodes switched on or off at once (ADR-224 decision 4).
object
The CLI logins a node that has no settings yet tries, in order (ADR-240 Inc.2 decision
12). Omitted or null: every CLI login, in the try order of Credentials & secrets. A node
with settings keeps its own order; switching off ignores it.
Responses
Section titled “Responses”Switched in one transaction. A node with settings keeps them; one with none gets input, login_order (every CLI login when it is left out) and the normal pace. Nothing is fetched at once: the logins are tried by the rotation within the lockout limits, and the configuration is fetched in the next scheduled run. The bundled oxidized is asked to re-read its node list
What a switch did.
object
Not switched on: no model is picked and the profile names none.
Switched by this call.
Named but not switched for another reason: already in that state, or not a node the caller can see.
Examplegenerated
{ "no_model": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "switched": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "unchanged": 1}No node, more than 5,000, an unknown input, an empty login_order or one naming a login that is not a CLI login or naming one twice, or a node with no settings switched on without input (invalid_config_backup, input_required)
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 ManageConfig; or the backup is switched on by an account restricted to folders (scope_unsupported), by a role without ManageCredentials, or by an API token (login_not_permitted)
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" }}This deployment has no write side (skeleton mode)
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" }}