Retrieve
Retrieve an Existing SSH Key
client.gpuDroplets.account.keys.retrieve(number | stringsshKeyIdentifier, RequestOptionsoptions?): KeyRetrieveResponse { ssh_key }
/v2/account/keys/{ssh_key_identifier}
To get information about a key, send a GET request to /v2/account/keys/$KEY_ID
or /v2/account/keys/$KEY_FINGERPRINT
.
The response will be a JSON object with the key ssh_key
and value an ssh_key object which contains the standard ssh_key attributes.
Parameters
Returns
Retrieve an Existing SSH Key
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const key = await client.gpuDroplets.account.keys.retrieve(512189);
console.log(key.ssh_key);
{
"ssh_key": {
"name": "My SSH Public Key",
"public_key": "ssh-rsa AEXAMPLEaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example"
}
}
Returns Examples
{
"ssh_key": {
"name": "My SSH Public Key",
"public_key": "ssh-rsa AEXAMPLEaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example"
}
}