put_remote
const url = 'https://example.com/api/v1/config-backup-remote';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"auth":"https_token","branch":"example","token":"example","url":"example","username":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/api/v1/config-backup-remote \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "auth": "https_token", "branch": "example", "token": "example", "url": "example", "username": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”The destination a person sets.
object
How the destination is reached.
The branch pushed to. Omitted: main.
The HTTPS access token. Omitted: keep the stored one, which is only kept for the same host and port.
https://host/owner/repo.git for a token, ssh://git@host/owner/repo.git or
git@host:owner/repo.git for a key.
The HTTPS user name (x-token-auth for a Bitbucket repository token).
Responses
Section titled “Responses”Set. With an SSH key, the response carries the public half to register as a deploy key
The destination, for the person who sets it.
object
The destination’s host keys learned on the first SSH push, as type SHA256:….
The public half of the SSH key, to register as a deploy key with write access.
How the last push went.
object
A destination is set.
Failed pushes in a row.
The host config backups go to — the URL’s host, not its path.
When a push last succeeded, and the commit the destination then held: the one a person finds there.
The HTTPS user name. The token is never returned.
Example
{ "auth": "https_token", "status": { "failure": "auth" }}A URL, branch, user name or token that is refused (invalid_config_backup_remote), or a destination moved to another host with no token of its own (token_required_for_new_address)
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" }}The caller lacks manage-system
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" }}