Skip to main content

public_keys

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

Overview

Namepublic_keys
TypeResource
Idgoogle.cloudshell.public_keys

Fields

The following fields are returned by SELECT queries:

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
add_public_keyinsertusersId, environmentsIdAdds a public SSH key to an environment, allowing clients with the corresponding private key to connect to that environment via SSH. If a key with the same content already exists, this will error with ALREADY_EXISTS.
remove_public_keydeleteusersId, environmentsIdRemoves a public SSH key from an environment. Clients will no longer be able to connect to the environment using the corresponding private key. If a key with the same content is not present, this will error with NOT_FOUND.

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
environmentsIdstring
usersIdstring

INSERT examples

Adds a public SSH key to an environment, allowing clients with the corresponding private key to connect to that environment via SSH. If a key with the same content already exists, this will error with ALREADY_EXISTS.

INSERT INTO google.cloudshell.public_keys (
data__key,
usersId,
environmentsId
)
SELECT
'{{ key }}',
'{{ usersId }}',
'{{ environmentsId }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples

Removes a public SSH key from an environment. Clients will no longer be able to connect to the environment using the corresponding private key. If a key with the same content is not present, this will error with NOT_FOUND.

DELETE FROM google.cloudshell.public_keys
WHERE usersId = '{{ usersId }}' --required
AND environmentsId = '{{ environmentsId }}' --required;