from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
ssh_key = client.cloud.ssh_keys.update(
ssh_key_id="36a7a97a-0672-4911-8f2b-92cd4e5b0d91",
project_id=1,
shared_in_project=True,
)
print(ssh_key.id)
{
"created_at": "2025-06-16T17:05:50Z",
"fingerprint": "86:75:ce:e7:e9:1e:f0:79:ec:6f:d8:92:9b:43:fc:4d",
"id": "36a7a97a-0672-4911-8f2b-92cd4e5b0d91",
"name": "my-ssh-key",
"project_id": 1,
"public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIjxL6g1II8NsO8odvBwGKvq2Dx/h/xrvsV9b9LVIYKm my-username@my-hostname",
"shared_in_project": true,
"state": "ACTIVE"
}
from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
ssh_key = client.cloud.ssh_keys.update(
ssh_key_id="36a7a97a-0672-4911-8f2b-92cd4e5b0d91",
project_id=1,
shared_in_project=True,
)
print(ssh_key.id)
{
"created_at": "2025-06-16T17:05:50Z",
"fingerprint": "86:75:ce:e7:e9:1e:f0:79:ec:6f:d8:92:9b:43:fc:4d",
"id": "36a7a97a-0672-4911-8f2b-92cd4e5b0d91",
"name": "my-ssh-key",
"project_id": 1,
"public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIjxL6g1II8NsO8odvBwGKvq2Dx/h/xrvsV9b9LVIYKm my-username@my-hostname",
"shared_in_project": true,
"state": "ACTIVE"
}
API key for authentication. Make sure to include the word apikey
, followed by a single space and then your token.
Example: apikey 1234$abcdef
Project ID
1
SSH key ID
"36a7a97a-0672-4911-8f2b-92cd4e5b0d91"
OK
The response is of type object
.
Was this page helpful?