Bucket

class oci.object_storage.models.Bucket(**kwargs)

Bases: object

A bucket is a container for storing objects in a compartment within a namespace. A bucket is associated with a single compartment. The compartment has policies that indicate what actions a user can perform on a bucket and all the objects in the bucket. For more information, see Managing Buckets.

To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, talk to an administrator. If you are an administrator who needs to write policies to give users access, see Getting Started with Policies.

Attributes

AUTO_TIERING_DISABLED A constant which can be used with the auto_tiering property of a Bucket.
AUTO_TIERING_INFREQUENT_ACCESS A constant which can be used with the auto_tiering property of a Bucket.
PUBLIC_ACCESS_TYPE_NO_PUBLIC_ACCESS A constant which can be used with the public_access_type property of a Bucket.
PUBLIC_ACCESS_TYPE_OBJECT_READ A constant which can be used with the public_access_type property of a Bucket.
PUBLIC_ACCESS_TYPE_OBJECT_READ_WITHOUT_LIST A constant which can be used with the public_access_type property of a Bucket.
STORAGE_TIER_ARCHIVE A constant which can be used with the storage_tier property of a Bucket.
STORAGE_TIER_STANDARD A constant which can be used with the storage_tier property of a Bucket.
VERSIONING_DISABLED A constant which can be used with the versioning property of a Bucket.
VERSIONING_ENABLED A constant which can be used with the versioning property of a Bucket.
VERSIONING_SUSPENDED A constant which can be used with the versioning property of a Bucket.
approximate_count Gets the approximate_count of this Bucket.
approximate_size Gets the approximate_size of this Bucket.
auto_tiering Gets the auto_tiering of this Bucket.
compartment_id [Required] Gets the compartment_id of this Bucket.
created_by [Required] Gets the created_by of this Bucket.
defined_tags Gets the defined_tags of this Bucket.
etag [Required] Gets the etag of this Bucket.
freeform_tags Gets the freeform_tags of this Bucket.
id Gets the id of this Bucket.
is_read_only Gets the is_read_only of this Bucket.
kms_key_id Gets the kms_key_id of this Bucket.
metadata [Required] Gets the metadata of this Bucket.
name [Required] Gets the name of this Bucket.
namespace [Required] Gets the namespace of this Bucket.
object_events_enabled Gets the object_events_enabled of this Bucket.
object_lifecycle_policy_etag Gets the object_lifecycle_policy_etag of this Bucket.
public_access_type Gets the public_access_type of this Bucket.
replication_enabled Gets the replication_enabled of this Bucket.
storage_tier Gets the storage_tier of this Bucket.
time_created [Required] Gets the time_created of this Bucket.
versioning Gets the versioning of this Bucket.

Methods

__init__(**kwargs) Initializes a new Bucket object with values from keyword arguments.
AUTO_TIERING_DISABLED = 'Disabled'

A constant which can be used with the auto_tiering property of a Bucket. This constant has a value of “Disabled”

AUTO_TIERING_INFREQUENT_ACCESS = 'InfrequentAccess'

A constant which can be used with the auto_tiering property of a Bucket. This constant has a value of “InfrequentAccess”

PUBLIC_ACCESS_TYPE_NO_PUBLIC_ACCESS = 'NoPublicAccess'

A constant which can be used with the public_access_type property of a Bucket. This constant has a value of “NoPublicAccess”

PUBLIC_ACCESS_TYPE_OBJECT_READ = 'ObjectRead'

A constant which can be used with the public_access_type property of a Bucket. This constant has a value of “ObjectRead”

PUBLIC_ACCESS_TYPE_OBJECT_READ_WITHOUT_LIST = 'ObjectReadWithoutList'

A constant which can be used with the public_access_type property of a Bucket. This constant has a value of “ObjectReadWithoutList”

STORAGE_TIER_ARCHIVE = 'Archive'

A constant which can be used with the storage_tier property of a Bucket. This constant has a value of “Archive”

STORAGE_TIER_STANDARD = 'Standard'

A constant which can be used with the storage_tier property of a Bucket. This constant has a value of “Standard”

VERSIONING_DISABLED = 'Disabled'

A constant which can be used with the versioning property of a Bucket. This constant has a value of “Disabled”

VERSIONING_ENABLED = 'Enabled'

A constant which can be used with the versioning property of a Bucket. This constant has a value of “Enabled”

VERSIONING_SUSPENDED = 'Suspended'

A constant which can be used with the versioning property of a Bucket. This constant has a value of “Suspended”

__init__(**kwargs)

Initializes a new Bucket object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • namespace (str) – The value to assign to the namespace property of this Bucket.
  • name (str) – The value to assign to the name property of this Bucket.
  • compartment_id (str) – The value to assign to the compartment_id property of this Bucket.
  • metadata (dict(str, str)) – The value to assign to the metadata property of this Bucket.
  • created_by (str) – The value to assign to the created_by property of this Bucket.
  • time_created (datetime) – The value to assign to the time_created property of this Bucket.
  • etag (str) – The value to assign to the etag property of this Bucket.
  • public_access_type (str) – The value to assign to the public_access_type property of this Bucket. Allowed values for this property are: “NoPublicAccess”, “ObjectRead”, “ObjectReadWithoutList”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • storage_tier (str) – The value to assign to the storage_tier property of this Bucket. Allowed values for this property are: “Standard”, “Archive”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • object_events_enabled (bool) – The value to assign to the object_events_enabled property of this Bucket.
  • freeform_tags (dict(str, str)) – The value to assign to the freeform_tags property of this Bucket.
  • defined_tags (dict(str, dict(str, object))) – The value to assign to the defined_tags property of this Bucket.
  • kms_key_id (str) – The value to assign to the kms_key_id property of this Bucket.
  • object_lifecycle_policy_etag (str) – The value to assign to the object_lifecycle_policy_etag property of this Bucket.
  • approximate_count (int) – The value to assign to the approximate_count property of this Bucket.
  • approximate_size (int) – The value to assign to the approximate_size property of this Bucket.
  • replication_enabled (bool) – The value to assign to the replication_enabled property of this Bucket.
  • is_read_only (bool) – The value to assign to the is_read_only property of this Bucket.
  • id (str) – The value to assign to the id property of this Bucket.
  • versioning (str) – The value to assign to the versioning property of this Bucket. Allowed values for this property are: “Enabled”, “Suspended”, “Disabled”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • auto_tiering (str) – The value to assign to the auto_tiering property of this Bucket. Allowed values for this property are: “Disabled”, “InfrequentAccess”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
approximate_count

Gets the approximate_count of this Bucket. The approximate number of objects in the bucket. Count statistics are reported periodically. You will see a lag between what is displayed and the actual object count.

Returns:The approximate_count of this Bucket.
Return type:int
approximate_size

Gets the approximate_size of this Bucket. The approximate total size in bytes of all objects in the bucket. Size statistics are reported periodically. You will see a lag between what is displayed and the actual size of the bucket.

Returns:The approximate_size of this Bucket.
Return type:int
auto_tiering

Gets the auto_tiering of this Bucket. The auto tiering status on the bucket. A bucket is created with auto tiering Disabled by default. For auto tiering InfrequentAccess, objects are transitioned automatically between the ‘Standard’ and ‘InfrequentAccess’ tiers based on the access pattern of the objects.

Allowed values for this property are: “Disabled”, “InfrequentAccess”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The auto_tiering of this Bucket.
Return type:str
compartment_id

[Required] Gets the compartment_id of this Bucket. The compartment ID in which the bucket is authorized.

Returns:The compartment_id of this Bucket.
Return type:str
created_by

[Required] Gets the created_by of this Bucket. The OCID of the user who created the bucket.

Returns:The created_by of this Bucket.
Return type:str
defined_tags

Gets the defined_tags of this Bucket. Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {“Operations”: {“CostCenter”: “42”}}

Returns:The defined_tags of this Bucket.
Return type:dict(str, dict(str, object))
etag

[Required] Gets the etag of this Bucket. The entity tag (ETag) for the bucket.

Returns:The etag of this Bucket.
Return type:str
freeform_tags

Gets the freeform_tags of this Bucket. Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {“Department”: “Finance”}

Returns:The freeform_tags of this Bucket.
Return type:dict(str, str)
id

Gets the id of this Bucket. The OCID of the bucket.

Returns:The id of this Bucket.
Return type:str
is_read_only

Gets the is_read_only of this Bucket. Whether or not this bucket is read only. By default, isReadOnly is set to false. This will be set to ‘true’ when this bucket is configured as a destination in a replication policy.

Returns:The is_read_only of this Bucket.
Return type:bool
kms_key_id

Gets the kms_key_id of this Bucket. The OCID of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key.

Returns:The kms_key_id of this Bucket.
Return type:str
metadata

[Required] Gets the metadata of this Bucket. Arbitrary string keys and values for user-defined metadata.

Returns:The metadata of this Bucket.
Return type:dict(str, str)
name

[Required] Gets the name of this Bucket. The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

Returns:The name of this Bucket.
Return type:str
namespace

[Required] Gets the namespace of this Bucket. The Object Storage namespace in which the bucket resides.

Returns:The namespace of this Bucket.
Return type:str
object_events_enabled

Gets the object_events_enabled of this Bucket. Whether or not events are emitted for object state changes in this bucket. By default, objectEventsEnabled is set to false. Set objectEventsEnabled to true to emit events for object state changes. For more information about events, see Overview of Events.

Returns:The object_events_enabled of this Bucket.
Return type:bool
object_lifecycle_policy_etag

Gets the object_lifecycle_policy_etag of this Bucket. The entity tag (ETag) for the live object lifecycle policy on the bucket.

Returns:The object_lifecycle_policy_etag of this Bucket.
Return type:str
public_access_type

Gets the public_access_type of this Bucket. The type of public access enabled on this bucket. A bucket is set to NoPublicAccess by default, which only allows an authenticated caller to access the bucket and its contents. When ObjectRead is enabled on the bucket, public access is allowed for the GetObject, HeadObject, and ListObjects operations. When ObjectReadWithoutList is enabled on the bucket, public access is allowed for the GetObject and HeadObject operations.

Allowed values for this property are: “NoPublicAccess”, “ObjectRead”, “ObjectReadWithoutList”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The public_access_type of this Bucket.
Return type:str
replication_enabled

Gets the replication_enabled of this Bucket. Whether or not this bucket is a replication source. By default, replicationEnabled is set to false. This will be set to ‘true’ when you create a replication policy for the bucket.

Returns:The replication_enabled of this Bucket.
Return type:bool
storage_tier

Gets the storage_tier of this Bucket. The storage tier type assigned to the bucket. A bucket is set to Standard tier by default, which means objects uploaded or copied to the bucket will be in the standard storage tier. When the Archive tier type is set explicitly for a bucket, objects uploaded or copied to the bucket will be stored in archive storage. The storageTier property is immutable after bucket is created.

Allowed values for this property are: “Standard”, “Archive”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The storage_tier of this Bucket.
Return type:str
time_created

[Required] Gets the time_created of this Bucket. The date and time the bucket was created, as described in RFC 2616.

Returns:The time_created of this Bucket.
Return type:datetime
versioning

Gets the versioning of this Bucket. The versioning status on the bucket. A bucket is created with versioning Disabled by default. For versioning Enabled, objects are protected from overwrites and deletes, by maintaining their version history. When versioning is Suspended, the previous versions will still remain but new versions will no longer be created when overwitten or deleted.

Allowed values for this property are: “Enabled”, “Suspended”, “Disabled”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The versioning of this Bucket.
Return type:str