compute

POST /v1/compute/ssh-keys

Register a public key so a future order can install it.

Все эндпоинты compute

Аутентификация

Отправьте ключ API в качестве токена носителя (bearer token). Ключ должен иметь разрешение billing.payment.manage; ключ без него отклоняется с кодом 403, а не 404.

Идентификатор вашей организации

Этот эндпоинт принимает 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 в вашей панели управления автоматически подставляет реальный идентификатор вашей организации и ваш собственный ключ, а также выполняет запрос к работающему 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Нет

Тело запроса

ИмяТипОбязательноЧто это
namestringДаWhat to call it. Unique within the organisation.
public_keystringДа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 tha…

Ответ

ИмяТипОбязательноЧто это
idstringДаThe provider's id — what an order sends in `ssh_keys`.
namestringДаWhat the customer calls it.
fingerprintstringДа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_keystringДаThe public half, as registered. The private half never reaches us.

Ошибки, которые может возвращать этот эндпоинт

401 · 403 · 422 · 429 · 503