A bucket is a container for objects stored in OSS. You must create a bucket before you upload an object to OSS. This topic describes how to run the mb command to create buckets.
./ossutil64 mb oss://bucketname [--acl <value>][--storage-class <value>][--redundancy-type <value>]
The following table describes the parameters that you can configure when you run this command.
|bucketname||The name of the bucket that you want to create. A bucket name must be globally unique within Object Storage Service (OSS). The name of a bucket cannot be changed after the bucket is created.|
|--acl||The access control list (ACL) of the bucket. Default value: private. Valid values:
|--storage-class||The storage class of the bucket. Default value: Standard. Valid values:
For more information about storage classes, see Overview.
|--redundancy-type||The redundancy type of the bucket. Valid values:
Notice ZRS is supported in the following regions: China (Shenzhen), China (Beijing), China (Hangzhou), China (Shanghai), China (Hong Kong), and Singapore.
- You can run the following command to create a bucket named examplebucket:
./ossutil64 mb oss://examplebucket
If you do not specify the region in which you want to create the bucket, the bucket is created in the region specified by the endpoint in the ossutil configuration file. For example, if the endpoint specified in the configuration file is
https://oss-cn-hangzhou.aliyuncs.com, the bucket is created in the China (Hangzhou) region.
- You can run the following command to create a bucket named examplebucket and set the bucket ACL to private, storage class to IA, and redundancy type to ZRS.
./ossutil64 mb oss://examplebucket --acl private --storage-class IA --redundancy-type ZRS
- If a similar output is displayed, the specified bucket is created.
To use ossutil to manage buckets that are located in different regions, you can use the -e option to use the endpoint of the specified bucket. To use ossutil to manage buckets that are owned by different Alibaba Cloud accounts, you can use the -i option to use the AccessKey ID of the specified account, and use the -k option to use the AccessKey secret of the specified account.
./ossutil64 mb oss://examplebucket -e oss-cn-shanghai.aliyuncs.com -i LTAI4Fw2NbDUCV8zYUzA**** -k 67DLVBkH7EamOjy2W5RVAHUY9H****
For more information the mb command, see Common options.