Class HMACKeyMetadata (2.2.1)

HMACKeyMetadata(client, access_id=None, project_id=None, user_project=None)

Metadata about an HMAC service account key withn Cloud Storage.

Parameters

NameDescription
client Client

client associated with the key metadata.

access_id str

(Optional) Unique ID of an existing key.

project_id str

(Optional) Project ID of an existing key. Defaults to client's project.

user_project str

(Optional) This parameter is currently ignored.

Properties

access_id

Access ID of the key.

Returns
TypeDescription
str or Noneunique identifier of the key within a project.

etag

ETag identifying the version of the key metadata.

Returns
TypeDescription
str or NoneETag for the version of the key's metadata.

id

ID of the key, including the Project ID and the Access ID.

Returns
TypeDescription
str or NoneID of the key.

path

Resource path for the metadata's key.

project

Project ID associated with the key.

Returns
TypeDescription
str or Noneproject identfier for the key.

service_account_email

Service account e-mail address associated with the key.

Returns
TypeDescription
str or Nonee-mail address for the service account which created the key.

state

Get / set key's state.

One of:

  • ACTIVE
  • INACTIVE
  • DELETED

Returns
TypeDescription
str or Nonekey's current state.

time_created

Retrieve the timestamp at which the HMAC key was created.

Returns
TypeDescription
datetime.datetime or NoneTypeDatetime object parsed from RFC3339 valid timestamp, or None if the bucket's resource has not been loaded from the server.

updated

Retrieve the timestamp at which the HMAC key was created.

Returns
TypeDescription
datetime.datetime or NoneTypeDatetime object parsed from RFC3339 valid timestamp, or None if the bucket's resource has not been loaded from the server.

user_project

Project ID to be billed for API requests made via this bucket.

This property is currently ignored by the server.

Methods

delete

delete(timeout=60, retry=<google.api_core.retry.Retry object>)

Delete the key from Cloud Storage.

Parameters
NameDescription
timeout float or tuple

(Optional) The amount of time, in seconds, to wait for the server response. See: configuring_timeouts

retry google.api_core.retry.Retry or google.cloud.storage.retry.ConditionalRetryPolicy

(Optional) How to retry the RPC. See: configuring_retries

Exceptions
TypeDescription
google.api_core.exceptions.NotFoundif the key does not exist on the back-end.

exists

exists(timeout=60, retry=<google.api_core.retry.Retry object>)

Determine whether or not the key for this metadata exists.

Parameters
NameDescription
timeout float or tuple

(Optional) The amount of time, in seconds, to wait for the server response. See: configuring_timeouts

retry google.api_core.retry.Retry or google.cloud.storage.retry.ConditionalRetryPolicy

(Optional) How to retry the RPC. See: configuring_retries

Returns
TypeDescription
boolTrue if the key exists in Cloud Storage.

reload

reload(timeout=60, retry=<google.api_core.retry.Retry object>)

Reload properties from Cloud Storage.

Parameters
NameDescription
timeout float or tuple

(Optional) The amount of time, in seconds, to wait for the server response. See: configuring_timeouts

retry google.api_core.retry.Retry or google.cloud.storage.retry.ConditionalRetryPolicy

(Optional) How to retry the RPC. See: configuring_retries

Exceptions
TypeDescription
google.api_core.exceptions.NotFoundif the key does not exist on the back-end.

update

update(timeout=60, retry=<google.cloud.storage.retry.ConditionalRetryPolicy object>)

Save writable properties to Cloud Storage.

Parameters
NameDescription
timeout float or tuple

(Optional) The amount of time, in seconds, to wait for the server response. See: configuring_timeouts

retry google.api_core.retry.Retry or google.cloud.storage.retry.ConditionalRetryPolicy

(Optional) How to retry the RPC. See: configuring_retries

Exceptions
TypeDescription
google.api_core.exceptions.NotFoundif the key does not exist on the back-end.