Show / Hide Table of Contents

Class Bucket

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.

Inheritance
object
Bucket
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Oci.ObjectstorageService.Models
Assembly: OCI.DotNetSDK.Objectstorage.dll
Syntax
public class Bucket

Properties

ApproximateCount

Declaration
[JsonProperty(PropertyName = "approximateCount")]
public long? ApproximateCount { get; set; }
Property Value
Type Description
long?

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.

ApproximateSize

Declaration
[JsonProperty(PropertyName = "approximateSize")]
public long? ApproximateSize { get; set; }
Property Value
Type Description
long?

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.

AutoTiering

Declaration
[JsonProperty(PropertyName = "autoTiering")]
[JsonConverter(typeof(ResponseEnumConverter))]
public Bucket.AutoTieringEnum? AutoTiering { get; set; }
Property Value
Type Description
Bucket.AutoTieringEnum?

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.

CompartmentId

Declaration
[Required(ErrorMessage = "CompartmentId is required.")]
[JsonProperty(PropertyName = "compartmentId")]
public string CompartmentId { get; set; }
Property Value
Type Description
string

The compartment ID in which the bucket is authorized.

Remarks

Required

CreatedBy

Declaration
[Required(ErrorMessage = "CreatedBy is required.")]
[JsonProperty(PropertyName = "createdBy")]
public string CreatedBy { get; set; }
Property Value
Type Description
string

The OCID of the user who created the bucket.

Remarks

Required

DefinedTags

Declaration
[JsonProperty(PropertyName = "definedTags")]
public Dictionary<string, Dictionary<string, object>> DefinedTags { get; set; }
Property Value
Type Description
Dictionary<string, Dictionary<string, object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations": {"CostCenter": "42"}}

Etag

Declaration
[Required(ErrorMessage = "Etag is required.")]
[JsonProperty(PropertyName = "etag")]
public string Etag { get; set; }
Property Value
Type Description
string

The entity tag (ETag) for the bucket.

Remarks

Required

FreeformTags

Declaration
[JsonProperty(PropertyName = "freeformTags")]
public Dictionary<string, string> FreeformTags { get; set; }
Property Value
Type Description
Dictionary<string, string>

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"}

Id

Declaration
[JsonProperty(PropertyName = "id")]
public string Id { get; set; }
Property Value
Type Description
string

The OCID of the bucket.

IsReadOnly

Declaration
[JsonProperty(PropertyName = "isReadOnly")]
public bool? IsReadOnly { get; set; }
Property Value
Type Description
bool?

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.

KmsKeyId

Declaration
[JsonProperty(PropertyName = "kmsKeyId")]
public string KmsKeyId { get; set; }
Property Value
Type Description
string

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.

Metadata

Declaration
[Required(ErrorMessage = "Metadata is required.")]
[JsonProperty(PropertyName = "metadata")]
public Dictionary<string, string> Metadata { get; set; }
Property Value
Type Description
Dictionary<string, string>

Arbitrary string keys and values for user-defined metadata.

Remarks

Required

Name

Declaration
[Required(ErrorMessage = "Name is required.")]
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }
Property Value
Type Description
string

The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

Remarks

Required

Namespace

Declaration
[Required(ErrorMessage = "Namespace is required.")]
[JsonProperty(PropertyName = "namespace")]
public string Namespace { get; set; }
Property Value
Type Description
string

The Object Storage namespace in which the bucket resides.

Remarks

Required

ObjectEventsEnabled

Declaration
[JsonProperty(PropertyName = "objectEventsEnabled")]
public bool? ObjectEventsEnabled { get; set; }
Property Value
Type Description
bool?

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.

ObjectLifecyclePolicyEtag

Declaration
[JsonProperty(PropertyName = "objectLifecyclePolicyEtag")]
public string ObjectLifecyclePolicyEtag { get; set; }
Property Value
Type Description
string

The entity tag (ETag) for the live object lifecycle policy on the bucket.

PublicAccessType

Declaration
[JsonProperty(PropertyName = "publicAccessType")]
[JsonConverter(typeof(ResponseEnumConverter))]
public Bucket.PublicAccessTypeEnum? PublicAccessType { get; set; }
Property Value
Type Description
Bucket.PublicAccessTypeEnum?

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.

ReplicationEnabled

Declaration
[JsonProperty(PropertyName = "replicationEnabled")]
public bool? ReplicationEnabled { get; set; }
Property Value
Type Description
bool?

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.

StorageTier

Declaration
[JsonProperty(PropertyName = "storageTier")]
[JsonConverter(typeof(ResponseEnumConverter))]
public Bucket.StorageTierEnum? StorageTier { get; set; }
Property Value
Type Description
Bucket.StorageTierEnum?

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.

TimeCreated

Declaration
[Required(ErrorMessage = "TimeCreated is required.")]
[JsonProperty(PropertyName = "timeCreated")]
public DateTime? TimeCreated { get; set; }
Property Value
Type Description
DateTime?

The date and time the bucket was created, as described in RFC 2616.

Remarks

Required

Versioning

Declaration
[JsonProperty(PropertyName = "versioning")]
[JsonConverter(typeof(ResponseEnumConverter))]
public Bucket.VersioningEnum? Versioning { get; set; }
Property Value
Type Description
Bucket.VersioningEnum?

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.

In this article
Back to top