hmac_keys
Creates, updates, deletes, gets or lists a hmac_keys
resource.
Overview
Name | hmac_keys |
Type | Resource |
Id | google.storage.hmac_keys |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
id | string | The ID of the HMAC key, including the Project ID and the Access ID. |
accessId | string | The ID of the HMAC Key. |
etag | string | HTTP 1.1 Entity tag for the HMAC key. |
kind | string | The kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata. (default: storage#hmacKeyMetadata) |
projectId | string | Project ID owning the service account to which the key authenticates. |
selfLink | string | The link to this resource. |
serviceAccountEmail | string | The email address of the key's associated service account. |
state | string | The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED. |
timeCreated | string (date-time) | The creation time of the HMAC key in RFC 3339 format. |
updated | string (date-time) | The last modification time of the HMAC key metadata in RFC 3339 format. |
Successful response
Name | Datatype | Description |
---|---|---|
id | string | The ID of the HMAC key, including the Project ID and the Access ID. |
accessId | string | The ID of the HMAC Key. |
etag | string | HTTP 1.1 Entity tag for the HMAC key. |
kind | string | The kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata. (default: storage#hmacKeyMetadata) |
projectId | string | Project ID owning the service account to which the key authenticates. |
selfLink | string | The link to this resource. |
serviceAccountEmail | string | The email address of the key's associated service account. |
state | string | The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED. |
timeCreated | string (date-time) | The creation time of the HMAC key in RFC 3339 format. |
updated | string (date-time) | The last modification time of the HMAC key metadata in RFC 3339 format. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectId , accessId | userProject | Retrieves an HMAC key's metadata |
list | select | projectId | maxResults , pageToken , serviceAccountEmail , showDeletedKeys , userProject | Retrieves a list of HMAC keys matching the criteria. |
create | insert | projectId , serviceAccountEmail | userProject | Creates a new HMAC key for the specified service account. |
update | replace | projectId , accessId | userProject | Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states. |
delete | delete | projectId , accessId | userProject | Deletes an HMAC 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 |
---|---|---|
accessId | string | |
projectId | string | |
serviceAccountEmail | string | |
maxResults | integer (uint32) | |
pageToken | string | |
serviceAccountEmail | string | |
showDeletedKeys | boolean | |
userProject | string |
SELECT
examples
- get
- list
Retrieves an HMAC key's metadata
SELECT
id,
accessId,
etag,
kind,
projectId,
selfLink,
serviceAccountEmail,
state,
timeCreated,
updated
FROM google.storage.hmac_keys
WHERE projectId = '{{ projectId }}' -- required
AND accessId = '{{ accessId }}' -- required
AND userProject = '{{ userProject }}';
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 }}' -- required
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND serviceAccountEmail = '{{ serviceAccountEmail }}'
AND showDeletedKeys = '{{ showDeletedKeys }}'
AND userProject = '{{ userProject }}';
INSERT
examples
- create
- Manifest
Creates a new HMAC key for the specified service account.
INSERT INTO google.storage.hmac_keys (
projectId,
serviceAccountEmail,
userProject
)
SELECT
'{{ projectId }}',
'{{ serviceAccountEmail }}',
'{{ userProject }}'
RETURNING
kind,
metadata,
secret
;
# Description fields are for documentation purposes
- name: hmac_keys
props:
- name: projectId
value: string
description: Required parameter for the hmac_keys resource.
- name: serviceAccountEmail
value: string
description: Required parameter for the hmac_keys resource.
- name: userProject
value: string
REPLACE
examples
- update
Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.
REPLACE google.storage.hmac_keys
SET
data__accessId = '{{ accessId }}',
data__etag = '{{ etag }}',
data__id = '{{ id }}',
data__kind = '{{ kind }}',
data__projectId = '{{ projectId }}',
data__selfLink = '{{ selfLink }}',
data__serviceAccountEmail = '{{ serviceAccountEmail }}',
data__state = '{{ state }}',
data__timeCreated = '{{ timeCreated }}',
data__updated = '{{ updated }}'
WHERE
projectId = '{{ projectId }}' --required
AND accessId = '{{ accessId }}' --required
AND userProject = '{{ userProject}}'
RETURNING
id,
accessId,
etag,
kind,
projectId,
selfLink,
serviceAccountEmail,
state,
timeCreated,
updated;
DELETE
examples
- delete
Deletes an HMAC key.
DELETE FROM google.storage.hmac_keys
WHERE projectId = '{{ projectId }}' --required
AND accessId = '{{ accessId }}' --required
AND userProject = '{{ userProject }}';