Bucket的相关命令
ossutil提供了创建、删除、列举Bucket、以及为Bucket设置acl的功能,关于Bucket更多的管理功能暂时不支持,如需要请使用
osscmd。
在使用这些命令前,请先使用config命令配置访问AK。
创建Bucketossutil mb oss://bucket [--acl=acl] [--storage-class sc] [-c file]
其中acl如果不指定,则默认为private权限,如果成功创建,ossutil会打印消耗时间并退出,否则会输出错误信息。可以通过--storage-class选项指定存储方式。
关于创建Bucket的帮助信息,请使用ossutil help mb命令查看。
$./ossutil mb oss://test
0.220478(s) elapsed
删除Bucket
关于删除Bucket的帮助信息,请使用ossutil help rm命令查看。注意:
$./ossutil rm oss://test -b
Do you really mean to remove the Bucket: test(y or N)? y
0.220478(s) elapsed
$./ossutil ls
CreationTime Region StorageClass BucketName
2016-10-21 16:18:37 +0800 CST oss-cn-hangzhou Archive oss://go-sdk-test-bucket-xyz-for-object
2016-12-01 15:06:21 +0800 CST oss-cn-hangzhou Standard oss://ossutil-test
2016-07-18 17:54:49 +0800 CST oss-cn-hangzhou Standard oss://ossutilconfig
2016-07-20 10:36:24 +0800 CST oss-cn-hangzhou IA oss://ossutilupdate
2016-11-14 13:08:36 +0800 CST oss-cn-hangzhou IA oss://yyyyy
2016-08-25 09:06:10 +0800 CST oss-cn-hangzhou Archive oss://ztzt
2016-11-21 21:18:39 +0800 CST oss-cn-hangzhou Archive oss://ztztzt
Bucket Number is: 7
0.252174(s) elapsed
$./ossutil ls oss://ossutil-test
LastModifiedTime Size(B) StorageClass ETAG ObjectName
2016-12-01 15:06:37 +0800 CST 10363812 Standard 61DE142E5AFF9A6748707D4A77BFBCFB oss://ossutil-test/a1
2016-12-01 15:06:42 +0800 CST 10363812 Standard 61DE142E5AFF9A6748707D4A77BFBCFB oss://ossutil-test/a2
2016-12-01 15:06:45 +0800 CST 10363812 Standard 61DE142E5AFF9A6748707D4A77BFBCFB oss://ossutil-test/a3
Object Number is: 3
0.007379(s) elapsed
$ ossutil ls oss://bucket1 -a
LastModifiedTime Size(B) StorageClass ETAG ObjectName
2015-06-05 14:06:29 +0000 CST 201933 Standard 7E2F4A7F1AC9D2F0996E8332D5EA5B41 oss://bucket1/dir1/obj11
2015-06-05 14:36:21 +0000 CST 201933 Standard 6185CA2E8EB8510A61B3A845EAFE4174 oss://bucket1/obj1
2016-04-08 14:50:47 +0000 CST 6476984 Standard 4F16FDAE7AC404CEC8B727FCC67779D6 oss://bucket1/sample.txt
Object Number is: 3
InitiatedTime UploadID ObjectName
2017-01-13 03:45:26 +0000 CST 15754AF7980C4DFB8193F190837520BB oss://bucket1/obj1
2017-01-13 03:43:13 +0000 CST 2A1F9B4A95E341BD9285CC42BB950EE0 oss://bucket1/obj1
2017-01-13 03:45:25 +0000 CST 3998971ACAF94AD9AC48EAC1988BE863 oss://bucket1/obj2
2017-01-20 11:16:21 +0800 CST A20157A7B2FEC4670626DAE0F4C0073C oss://bucket1/tobj
UploadId Number is: 4
0.191289(s) elapsed
$ ossutil ls oss://bucket1 -d
oss://bucket1/obj1
oss://bucket1/sample.txt
oss://bucket1/dir1/
Object and Directory Number is: 3
UploadID ObjectName
15754AF7980C4DFB8193F190837520BB oss://bucket1/obj1
2A1F9B4A95E341BD9285CC42BB950EE0 oss://bucket1/obj1
3998971ACAF94AD9AC48EAC1988BE863 oss://bucket1/obj2
A20157A7B2FEC4670626DAE0F4C0073C oss://bucket1/tobj
UploadId Number is: 4
0.119884(s) elapsed
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。