Console: updates
Copy as MarkdownThese routes are on the console, port 3375. They take an API token as Authorization: Bearer ndt_...; see API tokens.
Server updates and the backups taken before them.
List the backups taken before updates.
Lists the backups the updater made before installs, newest first.
Needs server.config. neodesk updates backups calls it.
200: Done (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
array of object | yes |
data[].name |
string | yes |
data[].path |
string | yes |
data[].version |
string or null | |
data[].sha |
string | yes |
data[].timestamp |
string or null (date-time) | |
data[].filesBackedUp |
||
data[].fileCount |
integer or null | |
data[].sizeBytes |
integer | yes |
| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
Delete all but the newest update backups.
Keeps the newest keep backups and deletes the others. Logs it in the audit log when it deleted any.
Needs server.config. neodesk updates backups-prune calls it. It cannot be undone.
Request body, application/json:
| Field | Type | Required | What it is |
|---|---|---|---|
keep |
integer | yes | How many of the newest backups to keep; at least 1 |
200: Done (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
object | yes |
data.kept |
integer | yes |
data.deleted |
array of string | yes |
| Error | When |
|---|---|
| 400 | keep is not a positive whole number |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
Delete a backup taken before an update.
Logs it in the audit log.
Needs server.config. neodesk updates backup-delete calls it. It cannot be undone.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
name |
path | string | yes | The backup's name |
200: Done (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
object | yes |
| Error | When |
|---|---|
| 400 | The name is not valid, not found, or outside the backup folder |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 500 | The backup could not be deleted |
Show what changed in the newer release.
Needs server.config. neodesk updates changes calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
sha |
query | string | yes | The commit of the newest release: 7 to 40 hex digits |
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
success |
true |
yes | |
data |
object | yes | |
data.files |
array of object | yes | |
data.files[].path |
string | ||
data.files[].status |
string | ||
data.files[].component |
string | ||
data.grouped |
object | yes | The files grouped by component |
data.totalFiles |
integer | yes | |
data.compareTruncated |
boolean | yes | True when GitHub cut the list short |
data.commitsBehind |
integer | yes | |
data.commits |
array of object | yes | |
data.commits[].sha |
string | ||
data.commits[].message |
string | ||
data.commits[].date |
string (date-time) | ||
data.commits[].author |
string |
| Error | When |
|---|---|
| 400 | No valid sha, or not the commit of the newest release |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 500 | GitHub could not be asked |
| 503 | GitHub's rate limit is used up (code GITHUB_RATE_LIMIT) |
Show the update channel: stable or development.
Needs server.config. neodesk updates channel calls it.
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
success |
true |
yes | |
data |
object | yes | |
data.channel |
string, one of stable, development |
yes | |
data.branch |
string | yes | |
data.label |
string | yes | |
data.owner |
string | yes | The GitHub owner releases come from |
data.repo |
string | yes |
| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
Choose the update channel.
Needs server.config. neodesk updates channel-set calls it.
Request body, application/json:
| Field | Type | Required |
|---|---|---|
channel |
string, one of stable, development |
yes |
200: Done (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
object | yes |
data.channel |
string, one of stable, development |
yes |
data.branch |
string | yes |
data.label |
string | yes |
data.previousBranch |
string | yes |
data.previousChannel |
string | yes |
| Error | When |
|---|---|
| 400 | Not stable or development, or a Docker install, which picks its channel by image tag (code DOCKER_IMAGE_CHANNEL) |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
Check for a newer release.
Asks GitHub for the newest release of the update channel and compares it with the running version.
Needs server.config. neodesk updates check calls it.
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
success |
true |
yes | |
data |
object | yes | |
data.localVersion |
string | yes | |
data.localSHA |
string or null | yes | |
data.remoteSHA |
string | yes | The commit of the newest release; give it to the install |
data.updateAvailable |
boolean | yes | |
data.commitsBehind |
integer | ||
data.latestMessage |
string | ||
data.latestDate |
string or null (date-time) | ||
data.latestAuthor |
string | ||
data.components |
object | The parts of the release keyed by name | |
data.dockerShaUnknown |
boolean | ||
data.compareError |
string | ||
data.latestVersion |
string | yes | |
data.releaseTag |
string | ||
data.signature |
object | ||
data.signature.ok |
boolean | yes | |
data.signature.verified |
boolean | yes | Whether the release manifest's signature was checked and is good |
data.signature.code |
string | ||
data.signature.reason |
string | ||
data.updateChannel |
string | ||
data.githubBranch |
string | ||
data.githubOwner |
string | ||
data.githubRepo |
string | ||
data.deploymentMode |
string | ||
data.dockerImageMode |
boolean | ||
data.imageSHA |
string or null | ||
data.dockerUpdate |
object | How to update a Docker install, which updates its containers instead | |
data.dockerUpdate.channelNote |
string | ||
data.dockerUpdate.suggestedTags |
object | ||
data.dockerUpdate.currentTag |
string | ||
data.dockerUpdate.updateChannel |
string | ||
data.dockerUpdate.summary |
string | ||
data.dockerUpdate.commands |
array of string | The commands that update the containers | |
data.dockerUpdate.images |
array of string | ||
data.dockerUpdate.composeHint |
string | ||
data.dockerUpdate.layout |
string | ||
data.inAppUpdateSupported |
boolean |
| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 500 | GitHub could not be asked |
| 503 | GitHub's rate limit is used up (code GITHUB_RATE_LIMIT) |
Install the newest release (a backup is made first unless told not to).
Downloads the newest release of the update channel, checks it, makes a backup unless createBackup is false, puts the new files in place and logs it in the audit log. Under a supervisor the console exits two seconds after the answer, so that it starts again on the new binary. When the running version is the newest, it answers applied [] and the message No files to update. Docker installs update their containers instead and answer 400.
Needs server.config. neodesk updates install calls it.
Request body, application/json:
| Field | Type | Required | What it is |
|---|---|---|---|
remoteSHA |
string | yes | The commit check answered as remoteSHA: 7 to 40 hex digits |
createBackup |
boolean | default true |
200: Done (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
UpdateInstallResult or object | yes |
| Error | When |
|---|---|
| 400 | No valid remoteSHA, or a Docker install |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 409 | The newest release changed since the check: check again |
| 500 | The update failed, another update is running, or in-app updates are off on this install |
Install the Go toolchain (turned off: always answers 410).
Updates install prebuilt releases, so no Go toolchain is needed: the route always answers 410 and changes nothing.
Needs server.config. neodesk updates install-go calls it.
| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 410 | Updates install prebuilt releases; no Go toolchain is needed |
| default | Never answered: the route always answers 410 to a signed-in account with server.config |
Show how far an update got.
Needs server.config. neodesk updates status calls it.
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
success |
true |
yes | |
data |
object | yes | |
data.inProgress |
boolean | yes | |
data.marker |
object or null | yes | What the running install noted, null when none runs |
data.localSHA |
string or null | yes | The commit of the running binary |
data.lastResult |
object or null | yes | The stored result of the last install |
data.pending |
object | An update that waits for its first start, left out when there is none | |
data.pending.kind |
string | ||
data.pending.from |
string | ||
data.pending.to |
string | ||
data.pending.starts |
integer | ||
data.pending.at |
string (date-time) |
| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
Show how the last update ended.
Answers the stored result of the last install while it still has something to show, else null.
Needs server.config. neodesk updates last-result calls it.
200: Done (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
object or null | yes |
| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
Check that an update can be installed here.
Checks the disk space, the supervisor and the release before an install. ready is false when an issue would stop it.
Needs server.config. neodesk updates preflight calls it.
| Parameter | In | Type | What it is |
|---|---|---|---|
sha |
query | string | The commit of the release to check, from GET /api/settings/updates/check |
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
success |
true |
yes | |
data |
object | yes | |
data.ready |
boolean | yes | |
data.issues |
array of string | yes | What stops an install |
data.warnings |
array of string | yes | |
data.capabilities |
ManagementCapabilities | ||
data.go |
object | ||
data.canBuildServer |
boolean | ||
data.disk |
object | ||
data.binaryDisk |
object | ||
data.remoteSHA |
string or null | ||
data.release |
object | ||
data.supervisor |
string or null | The service manager that restarts the server, null without one | |
data.dockerImageMode |
boolean | ||
data.dockerUpdate |
object | How to update a Docker install, which updates its containers instead | |
data.dockerUpdate.channelNote |
string | ||
data.dockerUpdate.suggestedTags |
object | ||
data.dockerUpdate.currentTag |
string | ||
data.dockerUpdate.updateChannel |
string | ||
data.dockerUpdate.summary |
string | ||
data.dockerUpdate.commands |
array of string | The commands that update the containers | |
data.dockerUpdate.images |
array of string | ||
data.dockerUpdate.composeHint |
string | ||
data.dockerUpdate.layout |
string |
| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
Go back to the version before an update, from its backup.
Puts the binary from the backup back in place and logs it in the audit log. Under a supervisor the console exits two seconds after the answer, so that it starts again on the new binary.
Needs server.config. neodesk updates rollback calls it. It cannot be undone.
Request body, application/json:
| Field | Type | Required | What it is |
|---|---|---|---|
backupName |
string | yes | The name GET /api/settings/updates/backups lists |
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
success |
true |
yes | |
data |
object | yes | |
data.restored |
integer | yes | Files put back |
data.removed |
integer | yes | |
data.version |
string | yes | |
data.sha |
string | yes | |
data.totalFiles |
integer | yes | |
data.consoleRestartBlocked |
string | Why the console does not restart by itself, when it does not |
| Error | When |
|---|---|
| 400 | No backupName, a backup that is not found or broken, or a backup of the old console |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 500 | The restore failed |
Install the release of the running version again.
Downloads the release of the running version and puts its binary in place again, and logs it in the audit log. Under a supervisor the console exits two seconds after the answer, so that it starts again on the new binary. Takes no body.
Needs server.config. neodesk updates binary-rebuild calls it.
200: Done (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
object | yes |
data.success |
true |
yes |
data.steps |
object | yes |
data.steps.download |
object | |
data.steps.deploy |
object | |
data.steps.restart |
object |
| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 500 | The repair failed |
Show the state of the server binary.
Needs server.config. neodesk updates binary-status calls it.
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
success |
true |
yes | |
data |
object | yes | |
data.stale |
boolean | yes | True when an automatic rollback put back the running binary |
data.reason |
|||
data.detail |
|||
data.sha |
|||
data.since |
|||
data.dockerMode |
boolean | ||
data.cliOutdated |
boolean | True when the command line's copy on a Linux host install is older than the server |
| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
Show the running version and how it was installed.
Updates install prebuilt releases, so the Go fields describe the running binary: buildMethod is release.
Needs server.config. neodesk updates server-info calls it.
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
success |
true |
yes | |
data |
object | yes | |
data.goAvailable |
boolean | ||
data.goVersion |
string | ||
data.goVersionNumber |
string | ||
data.goPath |
string | ||
data.goSource |
string | ||
data.goMeetsMinimum |
boolean | ||
data.goNeedsUpgrade |
boolean | ||
data.goMinimumVersion |
string | ||
data.vendoredGoInstalled |
boolean | ||
data.canInstallGo |
boolean | ||
data.binaryPath |
string or null | The running server binary | |
data.sourcePresent |
boolean | ||
data.canAutoUpdate |
boolean | ||
data.buildMethod |
"release" |
| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |