compute

POST /v1/compute/ssh-keys

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

Tous les points de terminaison compute

Authentification

Envoyez une clé API en tant que jeton du porteur. La clé doit posséder l'autorisation billing.payment.manage ; une clé qui ne l'a pas est refusée avec le code 403, et non 404.

Où insérer l'ID de votre organisation

Cet point de terminaison prend org_id comme paramètre de requête. Omettez-le et l'appel couvrira l'ensemble de votre sous-arbre de location ; envoyez-le pour restreindre l'appel à une seule organisation.

L'identifiant de votre organisation se trouve sur l'écran des clés API de votre tableau de bord, à côté de la clé elle-même. Il s'agit du même identifiant pour chaque appel que vous effectuez.

Essayer

Remplacez tout ce qui se trouve entre crochets par vos propres valeurs, et le espace réservé à la clé par une clé de votre tableau de bord.

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> }'

Connecté ? La console d'API de votre tableau de bord saisit votre véritable ID d'organisation ainsi que votre propre clé, et exécute la requête sur l'API de production afin que vous puissiez voir la réponse réelle. Ouvrir ce point de terminaison dans la console API

Détails

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`.

Paramètres

NomTypeObligatoireQu'est-ce que c'est
org_id (query)UuidNon

Corps de la requête

NomTypeObligatoireQu'est-ce que c'est
namestringOuiWhat to call it. Unique within the organisation.
public_keystringOuiThe **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…

Réponse

NomTypeObligatoireQu'est-ce que c'est
idstringOuiThe provider's id — what an order sends in `ssh_keys`.
namestringOuiWhat the customer calls it.
fingerprintstringOuiThe **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_keystringOuiThe public half, as registered. The private half never reaches us.

Erreurs que cet point de terminaison peut renvoyer

401 · 403 · 422 · 429 · 503