El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a Bucket

Updated on 2024-04-15 GMT+08:00

Functions

This operation is used to create a bucket with a specified name.

NOTE:
  • By default, a user can have a maximum of 100 buckets.
  • The name of a deleted bucket can be reused for a bucket or a parallel file system at least 30 minutes after the deletion.
  • When creating a bucket in OBS, you can enable the multi-AZ mode for the bucket or disable it. With the multi-AZ mode disabled, data in a bucket is stored in a single AZ by default. With the multi-AZ mode enabled, data in a bucket is stored redundantly in multiple AZs, improving reliability. However, buckets created before are still in the single AZ mode.

A bucket name must be unique in OBS. If a user creates a bucket with the same name as that of an existing bucket under the same account and in the same region, a 200 code (indicating success) is returned. In scenarios other than the preceding one, the request for creating a bucket with the same name as that of an existing one will receive the 409 code (indicating that a namesake bucket already exists). To set an access control policy for the bucket to be created, you can add the x-obs-acl parameter to request headers.

Request Syntax

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
PUT / HTTP/1.1 
Host: bucketname.obs.region.example.com
Content-Length: length
Date: date
Authorization: authorization
x-obs-az-redundancy: 3az
 
<CreateBucketConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/">
    <Location>location</Location> 
</CreateBucketConfiguration>

Request Parameters

This request contains no parameters.

Request Headers

The operation message header is the same as that of a common request. For details, see Table 3. However, this request can contain additional headers. The following table describes the additional headers for this request.

Table 1 Additional request headers

Header

Description

Mandatory

x-obs-acl

When creating a bucket, you can add this header to set the permission control policy for the bucket. The predefined common policies are as follows: private, public-read, public-read-write, public-read-delivered, and public-read-write-delivered.

Type: string

No

x-obs-grant-read

This header grants the read permission to all users under an account. It allows you to list objects in a bucket, list multipart tasks in a bucket, list multi-version objects in a bucket, and obtain bucket metadata.

Type: string

Example: x-obs-grant-read:id=Tenant ID

No

x-obs-grant-write

This header grants the write permission to all users under an account. Therefore, the users can create, delete, and overwrite all objects in a bucket, and can initialize parts, upload parts, copy parts, merge parts, and cancel multipart upload tasks.

Type: string

Example: x-obs-grant-write:id=Tenant ID

No

x-obs-grant-read-acp

This header grants the ACL read permission to all users under an account. Therefore, the users can read the bucket ACL information.

Type: string

Example: x-obs-grant-read-acp:id=Account ID

No

x-obs-grant-write-acp

This header grants the ACL write permission to all users under an account. Therefore, the users can modify the ACL of the bucket.

Type: string

Example: x-obs-grant-write-acp:id=Account ID

No

x-obs-grant-full-control

This header grants the full control permission to all users under an account.

Type: string

Example: x-obs-grant-full-control:id=Account ID

No

x-obs-grant-read-delivered

This header grants the read permission to all users under an account. By default, the read permission is applied to all objects in the bucket.

Type: string

Example: x-obs-grant-read-delivered:id=Account ID

No

x-obs-grant-full-control-delivered

This header grants the full control permission to all users under an account. By default, the FULL_CONTROL permission is applied to all objects in the bucket.

Type: string

Example: x-obs-grant-full-control-delivered:id=Account ID

No

x-obs-az-redundancy

This header is carried in the request when creating a bucket to enable the multi-AZ mode for the bucket. If this header is not carried, the bucket is in the single AZ mode by default. This header is carried to specify that a newly created bucket uses multi-AZ storage. If the region where the bucket resides does not support multi-AZ storage, the bucket still uses the single-AZ storage.

Type: string

Example: x-obs-az-redundancy:3az

No

x-obs-fs-file-interface

This header can be carried when you create a bucket as a parallel file system.

Type: string

Example: x-obs-fs-file-interface:Enabled

No

Request Elements

This request can use additional elements. For details about additional elements, see Table 2.

Table 2 Additional request elements

Element

Description

Mandatory

Location

Specifies the region where a bucket will be created.

  • When creating a bucket using the endpoint of the default region, note the following:
    • If Location is not specified, the bucket is created in the default region.
    • If Location is specified to other region, the bucket is created in the specified region.
  • When creating a bucket using the endpoint of a non-default region, Location must be specified to the region corresponding to the endpoint.

Type: string

No

Response Syntax

1
2
3
4
HTTP/1.1 status_code
Location: location
Date: date
Content-Length: length

Response Headers

The response to the request uses common headers. For details, see Table 1.

Response Elements

This response contains no elements.

Error Responses

No special error responses are returned. For details about error responses, see Table 2.

Sample Request: Creating a Bucket

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
PUT / HTTP/1.1
User-Agent: curl/7.29.0
Host: examplebucket.obs.region.example.com
Accept: */*
Date: WED, 01 Jul 2015 02:25:05 GMT
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:75/Y4Ng1izvzc1nTGxpMXTE6ynw=
Content-Length: 157

<CreateBucketConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/">
</CreateBucketConfiguration>

Sample Response: Creating a Bucket

1
2
3
4
5
6
7
HTTP/1.1 200 OK
Server: OBS
x-obs-request-id: BF260000016435CE298386946AE4C482
Location: /examplebucket
x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCT9W2tcvLmMJ+plfdopaD62S0npbaRUz
Date: WED, 01 Jul 2015 02:25:06 GMT
Content-Length: 0

Sample Request: Creating a Bucket (with the ACL Specified)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
PUT / HTTP/1.1
User-Agent: curl/7.29.0
Host: examplebucket.obs.region.example.com
Accept: */*
Date: WED, 01 Jul 2015 02:25:05 GMT
x-obs-acl:public-read
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:75/Y4Ng1izvzc1nTGxpMXTE6ynw=
Content-Length: 157

<CreateBucketConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/">
</CreateBucketConfiguration>

Sample Response: Creating a Bucket (with the ACL Specified)

1
2
3
4
5
6
7
HTTP/1.1 200 OK
Server: OBS
x-obs-request-id: BF260000016435CE298386946AE4C482
Location: /examplebucket
x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCT9W2tcvLmMJ+plfdopaD62S0npbaRUz
Date: WED, 01 Jul 2015 02:25:06 GMT
Content-Length: 0

Sample Request: Creating a Bucket with Multi-AZ Storage

1
2
3
4
5
6
7
8
PUT / HTTP/1.1 
Host: examplebucket.obs.region.example.com
Content-Length: length 
Date: date 
Authorization: authorization 
x-obs-az-redundancy:3az 
<CreateBucketConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/">
</CreateBucketConfiguration>

Sample Response: Creating a Bucket with Multi-AZ Storage

1
2
3
4
5
6
7
8
HTTP/1.1 200 OK 
Server: OBS 
x-obs-request-id: BF260000016435CE298386946AE4C482 
Location: /examplebucket 
x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCT9W2tcvLmMJ+plfdopaD62S0npbaRUz 
Date: WED, 01 Jul 2015 02:25:06 GMT 
x-obs-az-redundancy:3az
Content-Length: 0

Sample Request: Creating a Parallel File System

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
PUT / HTTP/1.1
User-Agent: curl/7.29.0
Host: examplebucket.obs.region.example.com
Accept: */*
Date: WED, 01 Jul 2015 02:25:05 GMT
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:75/Y4Ng1izvzc1nTGxpMXTE6ynw=
Content-Length: 157
x-obs-fs-file-interface: Enabled

<CreateBucketConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/">
</CreateBucketConfiguration>

Sample Response: Creating a Parallel File System

1
2
3
4
5
6
7
HTTP/1.1 200 OK
Server: OBS
x-obs-request-id: BF260000016435CE298386946AE4C482
Location: /examplebucket
x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCT9W2tcvLmMJ+plfdopaD62S0npbaRUz
Date: WED, 01 Jul 2015 02:25:06 GMT
Content-Length: 0

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback