compute
POST /v1/compute/ssh-keys
Register a public key so a future order can install it.
Аутентификација
Пошаљите API кључ као bearer токен. Кључ мора имати дозволу billing.payment.manage; кључ без ње се одбија уз 403, а не 404.
Где се уноси ID ваше организације
Ова крајња тачка прихвата org_id као параметар упита. Изоставите га и позив ће обухватити цело подстабло вашег закупа; пошаљите га да бисте сузили позив на једну организацију.
Идентификатор ваше организације се налази на екрану са API кључевима на вашој контролној табли, поред самог кључа. То је исти идентификатор у сваком позиву који упутите.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
curl -X POST https://api.zinndigital.com/v1/compute/ssh-keys \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "name": <string>, "public_key": <string> }'Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
The provider is asked first and our row is written from its answer. A row written optimistically and then refused by the provider is a key the customer can select in the order form and that no machine can be built with — the refusal arriving after payment. ⛔ The public half only. A private key is refused 422 with a sentence telling the customer to treat it as compromised and rotate it, rather than quietly stripped: somebody who has just pasted a private key needs to know they exposed it. ⛔ A key already registered on the account is 422. Key names and fingerprints are unique account-wide at the provider, which our tenancy cannot change, so this is a collision the screen has to explain rather than hide. Requires billing.payment.manage.
Параметри
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
org_id (query) | Uuid | Не | — |
Тело захтева
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
name | string | Да | What to call it. Unique within the organisation. |
public_key | string | Да | The public half — the one-line file ending .pub. ⛔ A private key is refused 422 with a sentence telling the customer to treat it as compromised and rotate it, rather than… |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
id | string | Да | The provider's id — what an order sends in ssh_keys. |
name | string | Да | What the customer calls it. |
fingerprint | string | Да | The provider's fingerprint, verbatim. ⛔ Never recompute it: ours disagreeing with theirs is indistinguishable, on a screen, from the customer having uploaded the wrong key. |
public_key | string | Да | The public half, as registered. The private half never reaches us. |
Грешке које ова крајња тачка може вратити
401 · 403 · 422 · 429 · 503