hosting
POST /v1/sites/{siteId}/repo/sync/resolve
Clear a held sync by choosing which side wins.
ការផ្ទៀងផ្ទាត់ភាពត្រឹមត្រូវ
បញ្ជូនសោ API ជា bearer token។ សោនេះត្រូវតែមានសិទ្ធិ hosting.deploy.manage។ សោដែលគ្មានសិទ្ធិនេះនឹងត្រូវបដិសេធដោយកូដ 403 មិនមែន 404 ទេ។
ចំនុចបញ្ចប់នេះមិនត្រូវការលេខសម្គាល់ស្ថាប័នទេ។ ពស័្ដកូនរបស់អ្នករួចហើយកំណត់អត្តសញ្ញាណស្ថាប័នដែលវាជាកម្មសិទ្ធិ ហើយការឆ្លើយតបគឺត្រូវបានកំណត់វិសាលភាពទៅតាមនោះ។
សាកល្បង
ជំនួសអ្វីមួយនៅក្នុងសញ្ញាពងក្រពើ < > ដោយប្រើតម្លៃផ្ទាល់ខ្លួនរបស់អ្នក ហើយជំនួសកន្លែងរក្សាទុកសោដោយប្រើសោចេញពីផ្ទាំងគ្រប់គ្រងរបស់អ្នក។
curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/repo/sync/resolve \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "keep": <string<site, repository>> }'បានចូលគណនីរួចហើយមែនទេ? កុងសូល API ក្នុងផ្ទាំងគ្រប់គ្រងរបស់អ្នក បំពេញលេខសម្គាល់ស្ថាប័នពិតប្រាកដរបស់អ្នក និងសោផ្ទាល់ខ្លួនរបស់អ្នក ហើយដំណើរការសំណើទល់នឹង API ផ្ទាល់ ដូច្នេះអ្នកអាចមើលឃើញការឆ្លើយតបពិតប្រាកដ។ បើកចំណុចបញ្ចប់នេះក្នុងកុងសូល API
ព័ត៌មានលម្អិត
`keep: site` commits this site's files on top of the repository's current tip, so the other commits stay in the history rather than being erased. `keep: repository` applies the repository to the site, discarding the unsynced changes on our side — which is destructive, and is the only path that may overwrite them. There is deliberately no merge option: a platform neither party asked to arbitrate should not produce a file that neither of them wrote. Requires `hosting.deploy.manage`.
ប៉ារ៉ាម៉ែត្រ
| ឈ្មោះ | ប្រភេទ | តម្រូវការ | តើវាជាអ្វី |
|---|---|---|---|
siteId (path) | Uuid | បាទ/ចាស | Site ID (UUIDv7). |
សំណើរបស់រាងកាយ
| ឈ្មោះ | ប្រភេទ | តម្រូវការ | តើវាជាអ្វី |
|---|---|---|---|
keep | string<site, repository> | បាទ/ចាស | `site` keeps this site's files and commits them on top of the repository's current tip. `repository` discards the unsynced changes on our side and takes the repository's version… |
ផ្អាកដំណើរការ
| ឈ្មោះ | ប្រភេទ | តម្រូវការ | តើវាជាអ្វី |
|---|---|---|---|
site_id | string | បាទ/ចាស | — |
enabled | boolean | បាទ/ចាស | Whether the customer has switched two-way sync on. |
available | boolean | បាទ/ចាស | Whether it is permitted at all — true only once the customer has connected their OWN git account. False here makes `enabled` irrelevant; the engine will not sync either way. |
unavailable_reason | string | ទេ | A sentence the customer reads when `available` is false. Null when it is available. |
subdir | string | ទេ | Which directory of the site syncs. Empty means the whole document root. |
state | string<idle, synced, conflict, adopt, error, unsupported> | បាទ/ចាស | `unsupported` is TERMINAL and is not a failure either: the site is served from its repository, so there are no separate files on our side to push back. It leaves the sweep's rot… |
branch | string | ទេ | — |
repository | string | ទេ | `owner/repo`, or null when no repository is connected. |
conflict_commit | string | ទេ | The commit in the repository that we have not seen — the one the customer needs to look at before choosing. Null unless held. |
last_sync_at | string | ទេ | — |
last_sync_note | string | ទេ | — |
runs | SiteRepoSyncRun[] | បាទ/ចាស | The most recent runs, newest first. Includes the no-ops. |
កំហុសដែលចំណុចបញ្ចប់នេះអាចបង្វិលត្រឡប់មកវិញ
401 · 403 · 404 · 422 · 429