Update
Update an SSH Key's Name
client.gpuDroplets.account.keys.update(number | stringsshKeyIdentifier, KeyUpdateParams { name } body, RequestOptionsoptions?): KeyUpdateResponse { ssh_key }
/v2/account/keys/{ssh_key_identifier}
To update the name of an SSH key, send a PUT request to either /v2/account/keys/$SSH_KEY_ID
or /v2/account/keys/$SSH_KEY_FINGERPRINT
. Set the name
attribute to the new name you want to use.
Parameters
Returns
Update an SSH Key's Name
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const key = await client.gpuDroplets.account.keys.update(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"
}
}