public_keys
Creates, updates, deletes, gets or lists a public_keys
resource.
Overview
Name | public_keys |
Type | Resource |
Id | google.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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
add_public_key | insert | usersId , environmentsId | 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. | |
remove_public_key | delete | usersId , environmentsId | 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. |
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.
Name | Datatype | Description |
---|---|---|
environmentsId | string | |
usersId | string |
INSERT
examples
- add_public_key
- Manifest
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
;
# Description fields are for documentation purposes
- name: public_keys
props:
- name: usersId
value: string
description: Required parameter for the public_keys resource.
- name: environmentsId
value: string
description: Required parameter for the public_keys resource.
- name: key
value: string
description: >
Key that should be added to the environment. Supported formats are `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256` (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as <format> <content>, where <content> part is encoded with Base64.
DELETE
examples
- remove_public_key
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;