Skip to main content

account_keys

Creates, updates, deletes, gets or lists a account_keys resource.

Overview

Nameaccount_keys
TypeResource
Iddigitalocean.ssh_keys.account_keys

Fields

NameDatatypeDescription
column_anon``

Methods

NameAccessible byRequired ParamsDescription
ssh_keys_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.
ssh_keys_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.
ssh_keys_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.
ssh_keys_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.
ssh_keys_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.

SELECT examples

To 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.

SELECT
column_anon
FROM digitalocean.ssh_keys.account_keys
;

INSERT example

Use the following StackQL query and manifest file to create a new account_keys resource.

/*+ create */
INSERT INTO digitalocean.ssh_keys.account_keys (
data__public_key,
data__name
)
SELECT
'{{ public_key }}',
'{{ name }}'
;

DELETE example

Deletes the specified account_keys resource.

/*+ delete */
DELETE FROM digitalocean.ssh_keys.account_keys
WHERE ssh_key_identifier = '{{ ssh_key_identifier }}';