hosting
POST /v1/sites/{siteId}/cdn/swap
Move this site's CDN to a named destination.
身份验证
请将 API 密钥作为 bearer 令牌发送。该密钥必须具有 hosting.cdn.manage 权限;缺少该权限的密钥将被拒绝并返回 403 状态码,而非 404。
此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。
免费试用
将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。
curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/cdn/swap \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "to_kind": <string<platform, own, passthrough>> }'已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点
详细信息
Starts a durable move of this site's CDN to the destination you name, and answers 202 with a row to poll. ⭐ The one way a site's CDN moves. The deprecated switchSiteCdn and the staff rotateSiteCdn start this same workflow; they differ only in how the destination is named. switchSiteCdn takes {to_own: boolean}, which cannot name one of several accounts; this takes {to_kind, to_account_id}. ⭐⭐ Asynchronous because of a step no request can hold. The move only finishes once your registrar points at the destination's nameservers — minutes if the domain is registered with us, days if it is not. The source zone is removed only after the new nameservers are observed answering, so there is no moment at which your domain names an edge that is not there. Poll getSiteCdnSwap. Every step can be undone and every failure leaves the site serving: if the destination refuses the zone, or the credential has been revoked since you connected it, the site carries on being served exactly where it was. A Footprint-Free site needs footprint_acknowledged to move onto one account of your own (owner ruling G-3) — every site on one account can be linked to every other on it, which is the connection that line exists to prevent. Requires hosting.cdn.manage.
参数
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
siteId (path) | Uuid | 是 | Site ID (UUIDv7). |
请求正文
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
to_kind | string<platform, own, passthrough> | 是 | — |
to_account_id | object | 否 | Required when to_kind is own. ⛔ Must be one of your own connected accounts: an id naming a platform pool account is refused rather than honoured, because which pool… |
footprint_acknowledged | boolean | 否 | Required to move a Footprint-Free site off our pool (owner ruling G-3). |
passthrough_target | string | 否 | Required when to_kind is passthrough — the edge hostname your own CDN serves this site from. ⛔ Refused together with to_account_id: those are opposite operations and… |
passthrough_label | string | 否 | — |
响应
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
id | string | 是 | — |
site_id | string | 是 | — |
status | string<pending, creating, repointing, awaiting_delegation, completed, rolled_back, failed> | 是 | ⭐ awaiting_delegation is the state to render carefully: the move is complete on our side, both edges are serving the site, and it is waiting on your registrar. ⛔… |
from_kind | string | 是 | — |
from_label | string | 是 | — |
to_kind | string | 是 | — |
to_label | string | 是 | — |
to_account_id | object | 是 | — |
nameservers | string[] | 是 | The nameservers your domain must be delegated to. ⛔ The field this operation exists to deliver: without it the move never completes, and it does not fail either — it simply… |
nameservers_applied | boolean | 是 | Whether we set them (the domain is registered with us, or with a registrar you have connected) or you must. |
delegation_observed_at | object | 是 | When the new delegation was observed answering — never when it was requested. The source zone is not removed until this is set. |
old_zone_removed | boolean | 是 | An observation, not an intention. A source zone we could not delete leaves you being billed by that vendor for a site it no longer serves. |
records_copied | integer | 是 | How many of your OTHER DNS records were carried to the new zone. ⛔ Moving between two zone-owning CDNs re-delegates the whole domain, so your MX, SPF, DMARC and… |
records_source_read | boolean | 是 | Whether your existing records could be read at all. ⛔ Read this with records_copied, never instead of it: 0 is the truthful answer for a domain that has nothing but an… |
detail | string | 是 | — |
created_at | string | 是 | — |
completed_at | object | 是 | — |
in_flight | boolean | 是 | ⛔ awaiting_delegation counts as in flight. It is the state most likely to be read as finished — the site works, both edges serve it — and starting a second move from there would… |
cancellable | boolean | 是 | Whether DELETE can still put the site back. ⛔ Narrower than in_flight: false once the domain's nameservers have been changed or the new delegation has been seen answering,… |
此端点可能返回的错误
401 · 403 · 404 · 422 · 429 · 503