Skip to main content

account_keys

Overview

Nameaccount_keys
TypeResource
Iddigitalocean.ssh_keys.account_keys

Fields

NameDatatypeDescription
idintegerA unique identification number for this key. Can be used to embed a specific SSH key into a Droplet.
namestringA human-readable display name for this key, used to easily identify the SSH keys when they are displayed.
public_keystringThe entire public key string that was uploaded. Embedded into the root user's authorized_keys file if you include this key during Droplet creation.
fingerprintstringA unique identifier that differentiates this key from other keys using a format that SSH recognizes. The fingerprint is created when the key is added to your account.

Methods

NameAccessible byRequired ParamsDescription
sshKeys_getSELECTssh_key_identifierTo 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.
sshKeys_listSELECTTo list all of the keys in your account, send a GET request to /v2/account/keys. The response will be a JSON object with a key set to ssh_keys. The value of this will be an array of ssh_key objects, each of which contains the standard ssh_key attributes.
sshKeys_createINSERTdata__name, data__public_keyTo add a new SSH public key to your DigitalOcean account, send a POST request to /v2/account/keys. Set the name attribute to the name you wish to use and the public_key attribute to the full public key you are adding.
sshKeys_deleteDELETEssh_key_identifierTo destroy a public SSH key that you have in your account, send a DELETE request to /v2/account/keys/$KEY_ID or /v2/account/keys/$KEY_FINGERPRINT.
A 204 status will be returned, indicating that the action was successful and that the response body is empty.
_sshKeys_getEXECssh_key_identifierTo 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.
_sshKeys_listEXECTo list all of the keys in your account, send a GET request to /v2/account/keys. The response will be a JSON object with a key set to ssh_keys. The value of this will be an array of ssh_key objects, each of which contains the standard ssh_key attributes.
sshKeys_updateEXECssh_key_identifierTo 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.