Applicable Scenario
To start using Cloud Object Storage (COS), you need to create a bucket for using and managing objects. You can create a bucket through the console, APIs, or SDKs.
If the bucket does not exist, you can use the following code example to create a bucket in the specified region. The bucket supports the following parameters:
- Bucket: This is used to specify your full bucket name, such as
testbuc-125235912. - Region: It is used to choose your service region of the cloud platform. Once you create it, you cannot move or modify the bucket.
Usage Instructions
Using the REST API
You can directly use the REST API to initiate a bucket creating request. For more information, see Put Bucket.
Using Java SDKs
COS supports AWS Java SDK. See Using AWS S3 SDK to Access COS to access COS, and operate according to the Put Bucket section in the official documentation of AWS Java SDK 2.20.0.