Skip to main content

hmac_keys

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

Overview

Namehmac_keys
TypeResource
Idgoogle.storage.hmac_keys

Fields

NameDatatypeDescription
idstringThe ID of the HMAC key, including the Project ID and the Access ID.
accessIdstringThe ID of the HMAC Key.
etagstringHTTP 1.1 Entity tag for the HMAC key.
kindstringThe kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata.
projectIdstringProject ID owning the service account to which the key authenticates.
selfLinkstringThe link to this resource.
serviceAccountEmailstringThe email address of the key's associated service account.
statestringThe state of the key. Can be one of ACTIVE, INACTIVE, or DELETED.
timeCreatedstringThe creation time of the HMAC key in RFC 3339 format.
updatedstringThe last modification time of the HMAC key metadata in RFC 3339 format.

Methods

NameAccessible byRequired ParamsDescription
getSELECTaccessId, projectIdRetrieves an HMAC key's metadata
listSELECTprojectIdRetrieves a list of HMAC keys matching the criteria.
createINSERTprojectId, serviceAccountEmailCreates a new HMAC key for the specified service account.
deleteDELETEaccessId, projectIdDeletes an HMAC key.
updateREPLACEaccessId, projectIdUpdates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.

SELECT examples

Retrieves a list of HMAC keys matching the criteria.

SELECT
id,
accessId,
etag,
kind,
projectId,
selfLink,
serviceAccountEmail,
state,
timeCreated,
updated
FROM google.storage.hmac_keys
WHERE projectId = '{{ projectId }}';

INSERT example

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

/*+ create */
INSERT INTO google.storage.hmac_keys (
projectId,
serviceAccountEmail
)
SELECT
'{{ projectId }}',
'{{ serviceAccountEmail }}'
;

REPLACE example

Replaces all fields in the specified hmac_keys resource.

/*+ update */
REPLACE google.storage.hmac_keys
SET
accessId = '{{ accessId }}',
etag = '{{ etag }}',
projectId = '{{ projectId }}',
serviceAccountEmail = '{{ serviceAccountEmail }}',
state = '{{ state }}',
timeCreated = '{{ timeCreated }}',
updated = '{{ updated }}'
WHERE
accessId = '{{ accessId }}'
AND projectId = '{{ projectId }}';

DELETE example

Deletes the specified hmac_keys resource.

/*+ delete */
DELETE FROM google.storage.hmac_keys
WHERE accessId = '{{ accessId }}'
AND projectId = '{{ projectId }}';