hosting
PUT /v1/sites/{siteId}/php-version
Switch a site's PHP version.
Autentifikatsiya
API kalitini bearer token sifatida yuboring. Kalit hosting.php.manage ruxsatiga ega boʻlishi shart; ruxsatsiz kalit 404 emas, balki 403 xatosi bilan rad etiladi.
Bu yakuniy nuqta hech qanday tashkilot identifikatorini qabul qilmaydi. Sizning kalitingiz unga tegishli tashkilotni allaqachon aniqlaydi va javob shunga qarab cheklanadi.
Sinab ko'rish
Qavslardagi har qanday narsani o'z qiymatlaringiz bilan, kalit pleysxolderini эsa boshqaruv panelingizdagi kalit bilan almashtiring.
curl -X PUT https://api.zinndigital.com/v1/sites/{siteId}/php-version \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "version": <string> }'Tizimga kirganmisiz? Boshqaruv panelingizdagi API konsoli haqiqiy tashkilot ID raqamingiz va shaxsiy kalitingizni avtomatik to'ldiradi hamda haqiqiy javobni ko'rishingiz uchun so'rovni jonli API orqali bajaradi. Ushbu yakuniy nuqtani API konsolida oching
Tafsilotlar
Sets the site's desired PHP version and returns `202 Accepted`. The target must be a version currently offered for the site's product line (or the site's own current version); anything else is a `422`. A retired version an existing site already runs is kept — this call never forces a migration. Requires `hosting.php.manage`. **The machine serving the site is told before the row is written**, on both lines: one ack-checked vendor call on the resold range, and one idempotent `cloudlinux-selector set --current-version=` on our own fleet. A version the machine refuses is a `422` and the row is left alone, so the platform never claims a runtime the box is not running. `202` therefore under-promises rather than over-promises. A site with no hosting vendor and no placed worker has nothing serving it yet: the desired version is recorded and provisioning applies it. A machine that cannot be **reached at all** — its account does not exist yet, SSH is down, the vendor is unavailable — is a `503`, not a `422` and not a `500`: the request was valid and a retry can succeed. The stored version is left exactly as it was, so a `503` here means nothing changed anywhere.
Parametrlar
| Nomi | Turi | Majburiy | Nima bu |
|---|---|---|---|
siteId (path) | Uuid | Ha | Site ID (UUIDv7). |
Soʻrov tanasi
| Nomi | Turi | Majburiy | Nima bu |
|---|---|---|---|
version | string | Ha | A version offered for the site's product line (or the site's current one). |
Javob
| Nomi | Turi | Majburiy | Nima bu |
|---|---|---|---|
version | string | Ha | The site's effective PHP version (its own, or its line's default). |
available | string[] | Ha | Versions the site may switch to — those offered for its product line, plus its own current version even if that has since been retired (grandfathered). |
applied | boolean | Yo'q | Whether the machine serving this site was actually told, and the change read back off it. Present on the `PUT` response only. `false` is not a failure: it means the site has no… |
Ushbu yakuniy nuqta qaytarishi mumkin bo'lgan xatolar
401 · 403 · 404 · 422 · 429 · 503