OpenAPI Türkçe gyrohosting.com ↗

SSH keys

Account-level public keys you can install on new servers.

#GET/cloud/ssh-keys

List SSH keysScope: cloud_readlistSshKeysOpenAPI for this operation

Parameters

FieldinTypeDescription
pagequeryinteger
limitqueryinteger

Responses

200SSH keys — data: array<SshKey>
401Missing, invalid or revoked key

Examples

curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro ssh-key list
# resource gyro_ssh_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/ssh_key
resource "gyro_ssh_key" "laptop" {
  name       = "laptop"
  public_key = file("~/.ssh/id_ed25519.pub")
}
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);

#POST/cloud/ssh-keys

Add an SSH keyScope: cloud_writecreateSshKeyOpenAPI for this operation

Accepts ssh-ed25519, ecdsa-sha2-nistp256/384/521, sk-ssh-ed25519 and ssh-rsa (2048 bit or more). At most 50 keys per account; fingerprints are unique per account.

Request body

FieldTypeDescription
name requiredstring
public_key requiredstring

Responses

201Created — data: SshKey
401Missing, invalid or revoked key
403Key lacks the scope, IP not allowed, or feature disabled
409State conflict (server_locked, not_actionable, ssh_key_exists, server_limit, idempotency_in_flight)
422Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)

Examples

curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "laptop", "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFaA... me@laptop"}'
gyro ssh-key create --help    # all flags
# resource gyro_ssh_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/ssh_key
resource "gyro_ssh_key" "laptop" {
  name       = "laptop"
  public_key = file("~/.ssh/id_ed25519.pub")
}
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys", headers=h, json={"name": "laptop", "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFaA... me@laptop"}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"name": "laptop", "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFaA... me@laptop"}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);

#GET/cloud/ssh-keys/{id}

Get an SSH keyScope: cloud_readgetSshKeyOpenAPI for this operation

Parameters

FieldinTypeDescription
id requiredpathinteger

Responses

200SSH key — data: SshKey
404Not found — also returned for objects owned by someone else

Examples

curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro ssh-key get 12345
# resource gyro_ssh_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/ssh_key
resource "gyro_ssh_key" "laptop" {
  name       = "laptop"
  public_key = file("~/.ssh/id_ed25519.pub")
}
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);

#DELETE/cloud/ssh-keys/{id}

Delete an SSH keyScope: cloud_writedeleteSshKeyOpenAPI for this operation

Removes the key from your account. Servers that already have it keep it.

Parameters

FieldinTypeDescription
id requiredpathinteger

Responses

200Deleted — data: object
404Not found — also returned for objects owned by someone else

Examples

curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro ssh-key delete 12345
# resource gyro_ssh_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/ssh_key
resource "gyro_ssh_key" "laptop" {
  name       = "laptop"
  public_key = file("~/.ssh/id_ed25519.pub")
}
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);