百度智能云

All Product Document

          Object Storage

          PutBucket

          Interface Description

          This interface is used to create buckets. Each user is only allowed to create 100 buckets. The permission of the bucket created is private by default. That is, the bucket owner has the FULL_CONTROL permission, while others have no permission.

          Request

          • Request syntax

                PUT / HTTP/1.1
                Host: <BucketName>.bj.bcebos.com
                Date: <Date>
                Authorization: <AuthorizationString>
                Content-Length: <ContentLength>
                Content-Type: text/plain
          • Request header field

            No special header parameters.

          • Request parameters

            Name Type Description Required?
            enableMultiAZ Boolean Specify whether the data in the bucket created is distributed in multiple availability zones (AZ) to achieve the data center level disaster recovery. true represents the creation of a multi-AZ bucket. It is false by default, which represents the creation. No

          Response

          • Response header field

            No special header parameter.

          • Response element

            None

          Considerations

          • If a user creates more than 100 buckets, the service returns 400 Bad Request: TooManyBuckets.
          • If the requested bucket already exists, it returns 409 Conflict: BucketAlreadyExists regardless of whether the requestor creates this bucket.
          • The prerequisite of creating a bucket with the multi-AZ distribution of data is that this region already supports the creation of buckets with multiple AZs. BOS currently supports the Beijing and Guangzhou regions only, and other regions have not been enabled.

          Example

          • Request example

               PUT / HTTP/1.1
               Host: <BucketName>.bj.bcebos.com
               Date: Wed, 06 Apr 2016 06:34:40 GMT
               Authorization: <AuthorizationString>
               Content-Type:text/plain
               Content-Length: 0
            
               {
                   "enableMultiAz":true,
               }
          • Response example

               HTTP/1.1 200 OK
               x-bce-request-id: 4db2b34d-654d-4d8a-b49b-3049ca786409
               Date: Wed, 06 Apr 2016 06:34:40 GMT
               Location: bj
               Content-Length: 0
               Connection: close
               Server: BceBos
          Previous
          OPTIONSObject
          Next
          PutBucketStorageclass