Skip to content

switch_config_backups

POST
/api/v1/config-backups/switch
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" ] }'
Media typeapplication/json

Many nodes switched on or off at once (ADR-224 decision 4).

object
enabled
required
boolean
input
One of:
null
login_order

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.

Array<string> | null
node_ids
required
Array<string>

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

Media typeapplication/json

What a switch did.

object
no_model
required

Not switched on: no model is picked and the profile names none.

Array<string>
switched
required

Switched by this call.

Array<string>
unchanged
required

Named but not switched for another reason: already in that state, or not a node the caller can see.

integer
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)

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

No valid bearer token

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
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)

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

This deployment has no write side (skeleton mode)

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}