compute
POST /v1/compute/servers/{serverId}/packages
Put a website on a server.
Аутентификација
Пошаљите API кључ као bearer токен. Ова крајња тачка не наводи конкретну дозволу у спецификацији, па свом кључу доделите најмања неопходна овлашћења и проверите одговор уместо да претпостављате.
Ова крајња тачка не прихвата id организације. Ваш кључ већ идентификује организацију којој припада, а одговор је ограничен на њу.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
curl -X POST https://api.zinndigital.com/v1/compute/servers/{serverId}/packages \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "domain": <string>, "package_type": <string> }'Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
Creates a hosting package on the machine. This does not charge. The machine's package allowance at the provider is unlimited and the money was spent when the server was bought, so this is gated on sites.create and deliberately not on the billing key. A separate, reseller-wide call buys a standalone hosting product; this is not it. A domain the provider rejects - not a valid name, or already hosted on the account - returns 422 and creates nothing.
Параметри
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
serverId (path) | Uuid | Да | The server's id, as listComputeServers reports it. Ours (UUIDv7), minted when the order row was written — never the provider's own identifier for the machine. |
Тело захтева
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
domain | string | Да | The website's primary domain. |
package_type | string | Да | The id of a package type from GET /v1/compute/servers/{serverId}/packages. |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
id | string | Да | The provider's package identifier. |
domain | string | Да | The package's primary domain |
type_label | string | Да | The provider's label for the kind of package, or "". |
created_at | string | Да | ISO-8601 as the provider states it |
site_id | string | Да | Our site id for this website, or "" when we hold no record of it. This is what makes the website openable: every site surface - SSL, FTP, databases, subdomains, PHP, cron,… |
Грешке које ова крајња тачка може вратити
401 · 403 · 404 · 422 · 429 · 503