Skip to main content

ssh_public_keys

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

Overview

Namessh_public_keys
TypeResource
Idgoogle.oslogin.ssh_public_keys

Fields

NameDatatypeDescription
namestringOutput only. The canonical resource name.
expirationTimeUsecstringAn expiration time in microseconds since epoch.
fingerprintstringOutput only. The SHA-256 fingerprint of the SSH public key.
keystringPublic key text in SSH format, defined by RFC4253 section 6.6.

Methods

NameAccessible byRequired ParamsDescription
getSELECTsshPublicKeysId, usersIdRetrieves an SSH public key.
createINSERTusersIdCreate an SSH public key
deleteDELETEsshPublicKeysId, usersIdDeletes an SSH public key.
patchUPDATEsshPublicKeysId, usersIdUpdates an SSH public key and returns the profile information. This method supports patch semantics.

SELECT examples

Retrieves an SSH public key.

SELECT
name,
expirationTimeUsec,
fingerprint,
key
FROM google.oslogin.ssh_public_keys
WHERE sshPublicKeysId = '{{ sshPublicKeysId }}'
AND usersId = '{{ usersId }}';

INSERT example

Use the following StackQL query and manifest file to create a new ssh_public_keys resource.

/*+ create */
INSERT INTO google.oslogin.ssh_public_keys (
usersId,
key,
expirationTimeUsec
)
SELECT
'{{ usersId }}',
'{{ key }}',
'{{ expirationTimeUsec }}'
;

UPDATE example

Updates a ssh_public_keys resource.

/*+ update */
UPDATE google.oslogin.ssh_public_keys
SET
key = '{{ key }}',
expirationTimeUsec = '{{ expirationTimeUsec }}'
WHERE
sshPublicKeysId = '{{ sshPublicKeysId }}'
AND usersId = '{{ usersId }}';

DELETE example

Deletes the specified ssh_public_keys resource.

/*+ delete */
DELETE FROM google.oslogin.ssh_public_keys
WHERE sshPublicKeysId = '{{ sshPublicKeysId }}'
AND usersId = '{{ usersId }}';