ssh_public_keys
Creates, updates, deletes, gets or lists a ssh_public_keys resource.
Overview
| Name | ssh_public_keys |
| Type | Resource |
| Id | google.oslogin.ssh_public_keys |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
name | string | Output only. The canonical resource name. |
expirationTimeUsec | string (int64) | An expiration time in microseconds since epoch. |
fingerprint | string | Output only. The SHA-256 fingerprint of the SSH public key. |
key | string | Required. Public key text in SSH format, defined by RFC4253 section 6.6. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | usersId, sshPublicKeysId | Retrieves an SSH public key. | |
create | insert | usersId | Create an SSH public key | |
patch | update | usersId, sshPublicKeysId | updateMask | Updates an SSH public key and returns the profile information. This method supports patch semantics. |
delete | delete | usersId, sshPublicKeysId | Deletes an SSH public key. |
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 |
|---|---|---|
sshPublicKeysId | string | |
usersId | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- get
Retrieves an SSH public key.
SELECT
name,
expirationTimeUsec,
fingerprint,
key
FROM google.oslogin.ssh_public_keys
WHERE usersId = '{{ usersId }}' -- required
AND sshPublicKeysId = '{{ sshPublicKeysId }}' -- required
;
INSERT examples
- create
- Manifest
Create an SSH public key
INSERT INTO google.oslogin.ssh_public_keys (
data__expirationTimeUsec,
data__key,
usersId
)
SELECT
'{{ expirationTimeUsec }}',
'{{ key }}',
'{{ usersId }}'
RETURNING
name,
expirationTimeUsec,
fingerprint,
key
;
# Description fields are for documentation purposes
- name: ssh_public_keys
props:
- name: usersId
value: string
description: Required parameter for the ssh_public_keys resource.
- name: expirationTimeUsec
value: string
description: >
An expiration time in microseconds since epoch.
- name: key
value: string
description: >
Required. Public key text in SSH format, defined by [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6.
UPDATE examples
- patch
Updates an SSH public key and returns the profile information. This method supports patch semantics.
UPDATE google.oslogin.ssh_public_keys
SET
data__expirationTimeUsec = '{{ expirationTimeUsec }}',
data__key = '{{ key }}'
WHERE
usersId = '{{ usersId }}' --required
AND sshPublicKeysId = '{{ sshPublicKeysId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
expirationTimeUsec,
fingerprint,
key;
DELETE examples
- delete
Deletes an SSH public key.
DELETE FROM google.oslogin.ssh_public_keys
WHERE usersId = '{{ usersId }}' --required
AND sshPublicKeysId = '{{ sshPublicKeysId }}' --required
;