google.cloud.forseti.common.gcp_type.bucket module

A Bucket Resource.

See: https://cloud.google.com/storage/docs/json_api/v1/

class Bucket(bucket_id, full_name=None, data=None, name=None, display_name=None, parent=None, locations=None, lifecycle_state='LIFECYCLE_STATE_UNSPECIFIED')[source]

Bases: google.cloud.forseti.common.gcp_type.resource.Resource

Bucket resource.

RESOURCE_NAME_FMT = 'buckets/%s'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 182
_abc_registry = <_weakrefset.WeakSet object>
classmethod from_json(parent, json_string)[source]

Create a bucket from a JSON string.

Parameters:
  • parent (Resource) – resource this bucket belongs to.
  • json_string (str) – JSON string of a bucket GCP API response.
Returns:

bucket resource.

Return type:

Bucket

get_lifecycle_rule()[source]

Create a bucket lifecycle’s rules dict from its JSON string. :returns: bucket lifecycle’s rules. :rtype: dict

class BucketLifecycleState[source]

Bases: google.cloud.forseti.common.gcp_type.resource.LifecycleState

Represents the Bucket’s LifecycleState.