hosting
PUT /v1/sites/{siteId}/build-env
Replace a site's whole build environment.
Аутентификација
Пошаљите API кључ као bearer токен. Кључ мора имати дозволу hosting.deploy.manage; кључ без ње се одбија уз 403, а не 404.
Ова крајња тачка не прихвата id организације. Ваш кључ већ идентификује организацију којој припада, а одговор је ограничен на њу.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
curl -X PUT https://api.zinndigital.com/v1/sites/{siteId}/build-env \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "variables": <object> }'Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
Replaces rather than merges, because that is the only shape in which DELETING a variable is expressible — merge semantics would make a rotated-out key undeletable, and it would keep reaching the customer's builds from a screen that no longer lists it. An empty variables object clears them all. Names must be POSIX environment-variable syntax and may not start with a prefix the build platform owns (CF_PAGES, GITHUB_). Requires hosting.deploy.manage.
Параметри
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
siteId (path) | Uuid | Да | Site ID (UUIDv7). |
Тело захтева
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
variables | object | Да | Name to new value, for the variables being set or replaced. A mapping rather than a list of key/value objects because a mapping cannot express a duplicate name — two rows with one… |
keep | string[] | Не | Names to retain unchanged. A name here that the store does not hold is ignored rather than refused — it means the variable was deleted elsewhere, and failing the whole save over… |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
names | string[] | Да | The variable names this site holds, sorted. |
applied | boolean | Не | Present only on a save to a Node.js, Python or Ruby site on our own servers: true means the running application received the variables and was restarted, false that it is not… |
Грешке које ова крајња тачка може вратити
401 · 403 · 404 · 422 · 429