- 2.17.0 (latest)
- 2.16.0
- 2.15.0
- 2.14.0
- 2.13.0
- 2.12.0
- 2.11.0
- 2.10.0
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.1
- 2.1.0
- 2.0.0
- 1.44.0
- 1.43.0
- 1.42.3
- 1.41.1
- 1.40.0
- 1.39.0
- 1.38.0
- 1.37.1
- 1.36.2
- 1.35.1
- 1.34.0
- 1.33.0
- 1.32.0
- 1.31.2
- 1.30.0
- 1.29.0
- 1.28.1
- 1.27.0
- 1.26.0
- 1.25.0
- 1.24.1
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
HMAC Key Metadata
class google.cloud.storage.hmac_key.HMACKeyMetadata(client, access_id=None, project_id=None, user_project=None)
Bases: object
Metadata about an HMAC service account key withn Cloud Storage.
Parameters
ACTIVE_STATE( = 'ACTIVE )
Key is active, and may be used to sign requests.
DELETED_STATE( = 'DELETED )
Key is deleted. It cannot be re-activated.
INACTIVE_STATE( = 'INACTIVE )
Key is inactive, and may not be used to sign requests.
It can be re-activated via update()
.
property access_id()
Access ID of the key.
delete(timeout=60, retry=<google.api_core.retry.Retry object>)
Delete the key from Cloud Storage.
Parameters
timeout (float* or [tuple*](https://python.readthedocs.io/en/latest/library/stdtypes.html#tuple)) – (Optional) The amount of time, in seconds, to wait for the server response.
Can also be passed as a tuple (connect_timeout, read_timeout). See
requests.Session.request()
documentation for details.retry (google.api_core.retry.Retry* or *google.cloud.storage.retry.ConditionalRetryPolicy) – (Optional) How to retry the RPC. A None value will disable retries. A google.api_core.retry.Retry value will enable retries, and the object will define retriable response codes and errors and configure backoff and timeout options.
A google.cloud.storage.retry.ConditionalRetryPolicy value wraps a Retry object and activates it only if certain conditions are met. This class exists to provide safe defaults for RPC calls that are not technically safe to retry normally (due to potential data duplication or other side-effects) but become safe to retry if a condition such as if_metageneration_match is set.
See the retry.py source code and docstrings in this package (google.cloud.storage.retry) for information on retry types and how to configure them.
:raises NotFound
:
if the key does not exist on the back-end.
property etag()
ETag identifying the version of the key metadata.
exists(timeout=60, retry=<google.api_core.retry.Retry object>)
Determine whether or not the key for this metadata exists.
Parameters
timeout (float* or [tuple*](https://python.readthedocs.io/en/latest/library/stdtypes.html#tuple)) – (Optional) The amount of time, in seconds, to wait for the server response.
Can also be passed as a tuple (connect_timeout, read_timeout). See
requests.Session.request()
documentation for details.retry (google.api_core.retry.Retry* or *google.cloud.storage.retry.ConditionalRetryPolicy) – (Optional) How to retry the RPC. A None value will disable retries. A google.api_core.retry.Retry value will enable retries, and the object will define retriable response codes and errors and configure backoff and timeout options.
A google.cloud.storage.retry.ConditionalRetryPolicy value wraps a Retry object and activates it only if certain conditions are met. This class exists to provide safe defaults for RPC calls that are not technically safe to retry normally (due to potential data duplication or other side-effects) but become safe to retry if a condition such as if_metageneration_match is set.
See the retry.py source code and docstrings in this package (google.cloud.storage.retry) for information on retry types and how to configure them.
Return type
Returns
True if the key exists in Cloud Storage.
property id()
ID of the key, including the Project ID and the Access ID.
property path()
Resource path for the metadata’s key.
property project()
Project ID associated with the key.
reload(timeout=60, retry=<google.api_core.retry.Retry object>)
Reload properties from Cloud Storage.
Parameters
timeout (float* or [tuple*](https://python.readthedocs.io/en/latest/library/stdtypes.html#tuple)) – (Optional) The amount of time, in seconds, to wait for the server response.
Can also be passed as a tuple (connect_timeout, read_timeout). See
requests.Session.request()
documentation for details.retry (google.api_core.retry.Retry* or *google.cloud.storage.retry.ConditionalRetryPolicy) – (Optional) How to retry the RPC. A None value will disable retries. A google.api_core.retry.Retry value will enable retries, and the object will define retriable response codes and errors and configure backoff and timeout options.
A google.cloud.storage.retry.ConditionalRetryPolicy value wraps a Retry object and activates it only if certain conditions are met. This class exists to provide safe defaults for RPC calls that are not technically safe to retry normally (due to potential data duplication or other side-effects) but become safe to retry if a condition such as if_metageneration_match is set.
See the retry.py source code and docstrings in this package (google.cloud.storage.retry) for information on retry types and how to configure them.
:raises NotFound
:
if the key does not exist on the back-end.
property service_account_email()
Service account e-mail address associated with the key.
property state()
Get / set key’s state.
One of:
* `ACTIVE`
* `INACTIVE`
* `DELETED`
property time_created()
Retrieve the timestamp at which the HMAC key was created.
Return type
datetime.datetime
orNoneType
Returns
Datetime object parsed from RFC3339 valid timestamp, or
None
if the bucket’s resource has not been loaded from the server.
update(timeout=60, retry=<google.cloud.storage.retry.ConditionalRetryPolicy object>)
Save writable properties to Cloud Storage.
Parameters
timeout (float* or [tuple*](https://python.readthedocs.io/en/latest/library/stdtypes.html#tuple)) – (Optional) The amount of time, in seconds, to wait for the server response.
Can also be passed as a tuple (connect_timeout, read_timeout). See
requests.Session.request()
documentation for details.retry (google.api_core.retry.Retry* or *google.cloud.storage.retry.ConditionalRetryPolicy) – (Optional) How to retry the RPC. A None value will disable retries. A google.api_core.retry.Retry value will enable retries, and the object will define retriable response codes and errors and configure backoff and timeout options.
A google.cloud.storage.retry.ConditionalRetryPolicy value wraps a Retry object and activates it only if certain conditions are met. This class exists to provide safe defaults for RPC calls that are not technically safe to retry normally (due to potential data duplication or other side-effects) but become safe to retry if a condition such as if_metageneration_match is set.
See the retry.py source code and docstrings in this package (google.cloud.storage.retry) for information on retry types and how to configure them.
:raises NotFound
:
if the key does not exist on the back-end.
property updated()
Retrieve the timestamp at which the HMAC key was created.
Return type
datetime.datetime
orNoneType
Returns
Datetime object parsed from RFC3339 valid timestamp, or
None
if the bucket’s resource has not been loaded from the server.
property user_project()
Project ID to be billed for API requests made via this bucket.
This property is currently ignored by the server.
Return type