hosting
PUT /v1/sites/{siteId}/repo/sync
Turn two-way sync on or off for a site.
ការផ្ទៀងផ្ទាត់ភាពត្រឹមត្រូវ
បញ្ជូនសោ API ជា bearer token។ សោនេះត្រូវតែមានសិទ្ធិ hosting.deploy.manage។ សោដែលគ្មានសិទ្ធិនេះនឹងត្រូវបដិសេធដោយកូដ 403 មិនមែន 404 ទេ។
ចំនុចបញ្ចប់នេះមិនត្រូវការលេខសម្គាល់ស្ថាប័នទេ។ ពស័្ដកូនរបស់អ្នករួចហើយកំណត់អត្តសញ្ញាណស្ថាប័នដែលវាជាកម្មសិទ្ធិ ហើយការឆ្លើយតបគឺត្រូវបានកំណត់វិសាលភាពទៅតាមនោះ។
សាកល្បង
ជំនួសអ្វីមួយនៅក្នុងសញ្ញាពងក្រពើ < > ដោយប្រើតម្លៃផ្ទាល់ខ្លួនរបស់អ្នក ហើយជំនួសកន្លែងរក្សាទុកសោដោយប្រើសោចេញពីផ្ទាំងគ្រប់គ្រងរបស់អ្នក។
curl -X PUT https://api.zinndigital.com/v1/sites/{siteId}/repo/sync \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "enabled": <boolean> }'បានចូលគណនីរួចហើយមែនទេ? កុងសូល API ក្នុងផ្ទាំងគ្រប់គ្រងរបស់អ្នក បំពេញលេខសម្គាល់ស្ថាប័នពិតប្រាកដរបស់អ្នក និងសោផ្ទាល់ខ្លួនរបស់អ្នក ហើយដំណើរការសំណើទល់នឹង API ផ្ទាល់ ដូច្នេះអ្នកអាចមើលឃើញការឆ្លើយតបពិតប្រាកដ។ បើកចំណុចបញ្ចប់នេះក្នុងកុងសូល API
ព័ត៌មានលម្អិត
Free, and refused with 422 unless the customer has connected their own GitHub account. Turning it on does not push anything by itself — the first run is either the scheduled sweep or an explicit run. Requires `hosting.deploy.manage`.
ប៉ារ៉ាម៉ែត្រ
| ឈ្មោះ | ប្រភេទ | តម្រូវការ | តើវាជាអ្វី |
|---|---|---|---|
siteId (path) | Uuid | បាទ/ចាស | Site ID (UUIDv7). |
សំណើរបស់រាងកាយ
| ឈ្មោះ | ប្រភេទ | តម្រូវការ | តើវាជាអ្វី |
|---|---|---|---|
enabled | boolean | បាទ/ចាស | — |
subdir | string | ទេ | Restrict the sync to one directory of the site. Empty syncs the whole document root, which for a WordPress site is usually not what the customer wants. |
ផ្អាកដំណើរការ
| ឈ្មោះ | ប្រភេទ | តម្រូវការ | តើវាជាអ្វី |
|---|---|---|---|
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> | បាទ/ចាស | `conflict` and `adopt` are HELD, not failed — the sync stopped on purpose and is waiting for the customer to choose a side. |
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