account_keys
Creates, updates, deletes, gets or lists a account_keys
resource.
Overview
Name | account_keys |
Type | Resource |
Id | digitalocean.ssh_keys.account_keys |
Fields
Name | Datatype | Description |
---|---|---|
column_anon | `` |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
ssh_keys_get | SELECT | 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. |
ssh_keys_list | SELECT |
| 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. |
ssh_keys_create | INSERT | data__name, data__public_key | To 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_delete | DELETE | ssh_key_identifier | To 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_update | EXEC | 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. |
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.
- All Properties
- Manifest
/*+ create */
INSERT INTO digitalocean.ssh_keys.account_keys (
data__public_key,
data__name
)
SELECT
'{{ public_key }}',
'{{ name }}'
;
- name: account_keys
props:
- name: data__name
value: string
- name: data__public_key
value: string
- name: public_key
value: string
- name: name
value: string
DELETE
example
Deletes the specified account_keys
resource.
/*+ delete */
DELETE FROM digitalocean.ssh_keys.account_keys
WHERE ssh_key_identifier = '{{ ssh_key_identifier }}';