跳转至

创建桶

创建桶

make_bucket(bucket_name, location=us-east-1, object_lock=False)

参数

参数 类型 描述
bucket_name str 桶的名称
location str 地域
object_lock bool 是否开启对象锁定特性

示例

# Create bucket.
client.make_bucket("my-bucket")

# Create bucket on specific region.
client.make_bucket("my-bucket", "us-west-1")

# Create bucket with object-lock feature on specific region.
client.make_bucket("my-bucket", "eu-west-2", object_lock=True)