databases

POST /v1/databases/{databaseId}/upgrade

Move the database to a newer PostgreSQL major.

所有 databases 端点

所有开发者文档

身份验证

请将 API 密钥作为 bearer 令牌发送。此端点在规范中未指明具体的权限,因此请为您的密钥赋予所需的最小权限,并通过检查响应来确认,而不是盲目假设。

此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。

免费试用

将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。

curl -X POST https://api.zinndigital.com/v1/databases/{databaseId}/upgrade \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "engine_version": <string> }'

已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点

详细信息

Gated on databases.manage. Returns 202 — the upgrade runs as a durable workflow because the operator rolls the primary over to an upgraded replica, which takes minutes and must survive a deploy or the customer closing the tab. ⛔ Refused with 422 when the target is not a major we run, when it is not newer than the current one (downgrading is not possible), and — importantly — when the database has never been backed up: if a switchover goes wrong the way back is a restore, and a restore with no backup is not a way back.

参数

名称类型必填内容简介
databaseId (path)string

请求正文

名称类型必填内容简介
engine_versionstringThe engine major to move to. Must be one this platform offers for the database's own engine, and newer than its current one. ⛔ Compared as version numbers, not as text:…

响应

名称类型必填内容简介
idstring
labelstringThe customer's own name for it. Never sent to the infrastructure.
enginestring<postgres, mysql>Which engine this database runs (docs/497). Modelled as a field from the start, which is why MySQL was additive rather than a migration of every row.
engine_versionstringThe engine's major"18", "8.4". The patch level is ours to keep current and is deliberately not customer-selectable: choosing your own patch level means choosing to run…
engine_labelstringThe engine and version as a customer sees them — "PostgreSQL 18", "MySQL 8.4". Assembled by the API so three frontends cannot disagree about a product name.
sizestringA code from GET /v1/databases/catalogue.
statusstring<provisioning, available, failed, suspended, deleting, deleted>
status_detailstringWhy a failed instance failed. Empty otherwise.
hoststringEmpty until the instance is available.
portinteger
database_namestring
usernamestring
high_availabilitybooleanWhether a standby replica is held with automatic failover. The property customers actually choose on — stated rather than inferred from the size, because an inference goes…
vcpuinteger
ram_gbinteger
storage_gbinteger
tls_requiredbooleanAlways true. TLS is a precondition of selling a publicly reachable database, not a feature that can be turned off.
created_atstring
last_backup_atstringWhen a backup last completed. null means none has ever run.
order_line_idobjectThe paid basket line this database fulfils, or null for one that predates the purchase path or that staff tooling created. The subscription that bills it carries the same id.
billingManagedDatabaseBillingThe subscription paying for this database — what it costs, and when it next renews. ⛔ null means no subscription pays for it, which is a real state (a row created before…
restore_verified_atstringWhen a backup of this database was last proved restorable by restoring it and reading a row back over a client connection. ⛔ Deliberately separate from last_backup_at: a…

此端点可能返回的错误

401 · 403 · 404 · 422