CreateBucket
post
/n/{namespace_name}/b
Create a bucket in the given namespace with a bucket name and optional user-defined metadata. Avoid entering confidential information in bucket name.
Request
Supported Media Types
- application/json
Path Parameters
-
namespaceName(required): string
Minimum Length:
1
Pattern:[A-Za-z][A-Za-z0-9\\-_\\.]+
The Object Storage namespace used for the request.
Header Parameters
-
opc-client-request-id: string
The client request ID for tracing.
Request object for creating a bucket.
Root Schema : CreateBucketDetails
Type:
object
To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, talk to an administrator.
Show Source
-
autoTiering:
string
Set the auto tiering status on the bucket. By default, a bucket is created with auto tiering Disabled. Use this option to enable auto tiering during bucket creation. Objects in a bucket with auto tiering set to InfrequentAccess are transitioned automatically between the 'Standard' and 'InfrequentAccess' tiers based on the access pattern of the objects.
-
compartmentId(required):
string
The ID of the compartment in which to create the bucket.
-
definedTags:
object definedTags
Additional Properties Allowed: additionalPropertiesDefined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"Operations": {"CostCenter": "42"}}
-
freeformTags:
object freeformTags
Additional Properties Allowed: additionalPropertiesFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Example: {"Department": "Finance"}
-
kmsKeyId:
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:
object metadata
Additional Properties Allowed: additionalPropertiesArbitrary string, up to 4KB, of keys and values for user-defined metadata.
-
name(required):
string
Minimum Length:
1
Maximum Length:256
The name of the bucket. Valid characters are uppercase or lowercase letters, numbers, hyphens, underscores, and periods. Bucket names must be unique within an Object Storage namespace. Avoid entering confidential information. Example: my-new-bucket1 -
objectEventsEnabled:
boolean
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.
-
objectLevelAuditMode:
string
Allowed Values:
[ "Disabled", "Write", "ReadWrite" ]
The type of requests for which object-level audit logging is enabled on this bucket. This property is set to Disabled by default, where no audit logs will be produced at the object level for this bucket. If the property is set to Write, audit logs will be produced for operations such as Put Object. If the property is set to ReadWrite, audit logs will be produced for operations such as Put Object and Get Object. -
publicAccessType:
string
Allowed Values:
[ "NoPublicAccess", "ObjectRead", "ObjectReadWithoutList" ]
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. -
storageTier:
string
Allowed Values:
[ "Standard", "Archive", "Query" ]
The type of storage tier of this bucket. A bucket is set to 'Standard' tier by default, which means the bucket will be put in the standard storage tier. When 'Archive' tier type is set explicitly, the bucket is put in the Archive Storage tier. The 'storageTier' property is immutable after bucket is created. -
versioning:
string
Allowed Values:
[ "Enabled", "Disabled" ]
Set the versioning status on the bucket. By default, a bucket is created with versioning Disabled. Use this option to enable versioning during bucket creation. Objects in a version enabled bucket are protected from overwrites and deletions. Previous versions of the same object will be available in the bucket.
Nested Schema : definedTags
Type:
object
Additional Properties Allowed
Show Source
-
object additionalProperties
Additional Properties Allowed: additionalPropertiesKey-value pair representing a defined tag key and value, scoped to a namespace. Example: {"CostCenter": "42"}
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"Operations": {"CostCenter": "42"}}
Nested Schema : freeformTags
Type:
object
Additional Properties Allowed
Show Source
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Example: {"Department": "Finance"}
Nested Schema : metadata
Type:
object
Additional Properties Allowed
Show Source
Arbitrary string, up to 4KB, of keys and values for user-defined metadata.
Nested Schema : additionalProperties
Type:
object
Additional Properties Allowed
Show Source
-
object additionalProperties
The value of the tag. Only the String type is supported.
Key-value pair representing a defined tag key and value, scoped to a namespace. Example: {"CostCenter": "42"}
Nested Schema : additionalProperties
Type:
object
The value of the tag. Only the String type is supported.
Response
Supported Media Types
- application/json
200 Response
The complete bucket representation, including fields set by the server.
Headers
-
ETag: string
The entity tag (ETag) for the bucket that was created.
-
Location: string
The full path to the bucket that was created.
-
opc-client-request-id: string
Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging.
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Bucket
Type:
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.
Show Source
-
approximateCount:
integer(int64)
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:
integer(int64)
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.
-
approximateSizeMultipartUploads:
integer(int64)
The approximate total size in bytes of all uncommitted parts in the bucket. Size statistics are reported periodically. You will see a lag between what is displayed and the actual size of the uncommitted parts in the bucket.
-
autoTiering:
string
Allowed Values:
[ "Disabled", "InfrequentAccess" ]
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(required):
string
The compartment ID in which the bucket is authorized.
-
createdBy(required):
string
The OCID of the user who created the bucket.
-
definedTags:
object definedTags
Additional Properties Allowed: additionalPropertiesDefined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"Operations": {"CostCenter": "42"}}
-
etag(required):
string
The entity tag (ETag) for the bucket.
-
freeformTags:
object freeformTags
Additional Properties Allowed: additionalPropertiesFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Example: {"Department": "Finance"}
-
id:
string
The OCID of the bucket.
-
isReadOnly:
boolean
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:
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(required):
object metadata
Additional Properties Allowed: additionalPropertiesArbitrary string keys and values for user-defined metadata.
-
name(required):
string
The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
-
namespace(required):
string
The Object Storage namespace in which the bucket resides.
-
objectEventsEnabled:
boolean
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.
-
objectLevelAuditMode:
string
Allowed Values:
[ "Disabled", "Write", "ReadWrite" ]
The type of requests for which object-level audit logging is enabled on this bucket. This property is set to Disabled by default, where no audit logs will be produced at the object level for this bucket. If the property is set to Write, audit logs will be produced for operations such as Put Object. If the property is set to ReadWrite, audit logs will be produced for operations such as Put Object and Get Object. -
objectLifecyclePolicyEtag:
string
The entity tag (ETag) for the live object lifecycle policy on the bucket.
-
publicAccessType:
string
Allowed Values:
[ "NoPublicAccess", "ObjectRead", "ObjectReadWithoutList" ]
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:
boolean
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:
string
Allowed Values:
[ "Standard", "Archive" ]
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(required):
string(date-time)
The date and time the bucket was created, as described in [RFC 2616](https://tools.ietf.org/html/rfc2616#section-14.29).
-
versioning:
string
Allowed Values:
[ "Enabled", "Suspended", "Disabled" ]
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.
Nested Schema : definedTags
Type:
object
Additional Properties Allowed
Show Source
-
object additionalProperties
Additional Properties Allowed: additionalPropertiesKey-value pair representing a defined tag key and value, scoped to a namespace. Example: {"CostCenter": "42"}
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"Operations": {"CostCenter": "42"}}
Nested Schema : freeformTags
Type:
object
Additional Properties Allowed
Show Source
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Example: {"Department": "Finance"}
Nested Schema : metadata
Type:
object
Additional Properties Allowed
Show Source
Arbitrary string keys and values for user-defined metadata.
Nested Schema : additionalProperties
Type:
object
Additional Properties Allowed
Show Source
-
object additionalProperties
The value of the tag. Only the String type is supported.
Key-value pair representing a defined tag key and value, scoped to a namespace. Example: {"CostCenter": "42"}
Nested Schema : additionalProperties
Type:
object
The value of the tag. Only the String type is supported.
Example Response (application-json)
{ "namespace": "ansh8lvru1zp", "name": "MyBucket6", "compartmentId": "ocid1.compartment.unique_ID", "id": "ocid1.bucket.unique_ID", "createdBy": "ocid1.user.unique_ID", "timeCreated": "2016-08-09T01:11:38.639Z", "metadata": {}, "etag": "21edf865-d3d9-424f-8218-37188e803db8", "freeformTags": {"Department": "Finance"}, "definedTags": { "MyTags": { "CostCenter": "42", "Project": "Stealth", "CreatedBy": "BillSmith", "CreatedDate": "9/21/2017T14:00" }, "Audit": { "DataSensitivity": "PII", "CageSecurity": "High", "Simplicity": "complex" } } }
400 Response
Bad Request
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
401 Response
Unauthorized
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
404 Response
Not Found
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
408 Response
Request Timeout
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
409 Response
Conflict
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
411 Response
Content-Length Required
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
429 Response
Too Many Requests
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
500 Response
Internal Server Error
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
Default Response
An error has occurred.
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload