Skip to main content

ssh_keys

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

Overview​

Namessh_keys
TypeResource
Idgoogle.baremetalsolution.ssh_keys

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOutput only. The name of this SSH key. Currently, the only valid value for the location is "global".
publicKeystringThe public SSH key. This must be in OpenSSH .authorized_keys format.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectprojectsId, locationsIdpageSize, pageTokenLists the public SSH keys registered for the specified project. These SSH keys are used only for the interactive serial console feature.
createinsertprojectsId, locationsIdsshKeyIdRegister a public SSH key in the specified project for use with the interactive serial console feature.
deletedeleteprojectsId, locationsId, sshKeysIdDeletes a public SSH key registered in the specified project.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
projectsIdstring
sshKeysIdstring
pageSizeinteger (int32)
pageTokenstring
sshKeyIdstring

SELECT examples​

Lists the public SSH keys registered for the specified project. These SSH keys are used only for the interactive serial console feature.

SELECT
name,
publicKey
FROM google.baremetalsolution.ssh_keys
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;

INSERT examples​

Register a public SSH key in the specified project for use with the interactive serial console feature.

INSERT INTO google.baremetalsolution.ssh_keys (
data__publicKey,
projectsId,
locationsId,
sshKeyId
)
SELECT
'{{ publicKey }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ sshKeyId }}'
RETURNING
name,
publicKey
;

DELETE examples​

Deletes a public SSH key registered in the specified project.

DELETE FROM google.baremetalsolution.ssh_keys
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND sshKeysId = '{{ sshKeysId }}' --required
;