跳到正文

更新 ​

中心提供的可用更新,以及安装更新的请求。

本组中的操作及其访问规则、重试规则、参数和响应。每个请求都需携带密钥:Authorization: Bearer <密钥>(参见“身份验证”)。

操作 ​

获取更新状态 ​

GET HEAD /api/v1/system/updates

访问: 管理员 · 重试: 可安全重试(读取)

返回主机更新程序报告的信息:已安装的版本和数据库架构(schema)、发现的最新发布(latest)、自动更新设置(automatic、hourUTC、pin、channel、statistics)、phase(idle、checking、updating、failed)、上一次 error、上次心跳和设置的 revision,以及仍在更新程序邮箱中等待的请求(pending)。没有连接主机更新程序时,snapshot 为 null。把 revision 传给 requestSystemUpdate。

响应 200

字段类型必需规则
snapshotobject是可以为 null
snapshot.revisioninteger是0–2147483646
snapshot.currentVersionstring是匹配 ^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$
snapshot.currentSchemainteger是0–2147483647
snapshot.automaticboolean是—
snapshot.hourUTCinteger是0–23
snapshot.pinstring是匹配 ^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$; 可以为 null
snapshot.heartbeatAtstring (date-time)是—
snapshot.checkedAtstring (date-time)是可以为 null
snapshot.latestobject是可以为 null
snapshot.latest.versionstring是匹配 ^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$
snapshot.latest.schemainteger是0–2147483647
snapshot.latest.sha256string是SHA-256:64 位小写十六进制数字
snapshot.phasestring是取值之一:idle, checking, updating, failed
snapshot.errorstring是取值之一:check_failed, update_failed, conflict, maintenance_required, recovery_required, null; 可以为 null
snapshot.lastAttemptDaystring是可以为 null
snapshot.lastRequestIdstring (uuid)是可以为 null
snapshot.statisticsboolean否—
snapshot.channelstring否取值之一:stable, beta
pendingobject是取值之一:null
pending.idstring (uuid)是—
pending.expectedRevisioninteger是0–2147483646
pending.kindstring是取值之一:check
pending.versionstring是匹配 ^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$
pending.sha256string是SHA-256:64 位小写十六进制数字
pending.automaticboolean是—
pending.hourUTCinteger是0–23
pending.statisticsboolean否—

响应: 200, 400, 401, 403, 404, 409, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/system/updates" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

请求更新操作 ​

POST /api/v1/system/updates/requests

访问: 管理员 · 重试: 仅在携带预期修订版本时重试(compare-and-swap)

向主机更新程序下达一条由它执行的命令:kind 为 check 表示检查新发布版本,apply 表示安装给定的稳定版 version 及其 sha256,configure 表示设置 automatic、hourUTC 以及可选的 statistics。请将新的 UUID 作为 id 发送,并附上来自 getSystemUpdates 的 expectedRevision;409 revision_mismatch 表示设置已变化,503 busy 表示有请求正在等待或更新程序正在工作,503 unavailable 表示没有连接更新程序或其心跳已超过五分钟。响应 202 只表示请求已排队:请在 getSystemUpdates 中跟踪 phase、currentVersion 和 lastRequestId。使用相同的 id 和请求体重复请求是安全的。

请求正文 (application/json)

字段类型必需规则
idstring (uuid)是—
expectedRevisioninteger是0–2147483646
kindstring是取值之一:check
versionstring是匹配 ^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$
sha256string是SHA-256:64 位小写十六进制数字
automaticboolean是—
hourUTCinteger是0–23
statisticsboolean否—

响应 202

字段类型必需规则
idstring (uuid)是—

响应: 202, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

示例

bash
curl -X POST "$ARKVORY_URL/api/v1/system/updates/requests" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"id":"00000000-0000-4000-8000-000000000000","expectedRevision":0,"kind":"check"}'

Arkvory · ProAnimaStudio