Ops工具
Helm
Helm 包管理工具
Helm进阶
Ansible
Ansible入门
Ansible 常用模块指令
Ansible playbook详解
Vdbench
vdbench基础使用指南
vdbench在ARM服务器上出现共享库aarch64.so问题
GitLab
Gitlab自定义机器人
Gitlab安装和使用
CosBench
Cosbench测试
s3curl
s3curl常用命令大全
S3curl测试
FIO
FIO安装和使用方法
本文档使用 MrDoc 发布
-
+
首页
S3curl测试
# endpoint配置 接入点在s3curl软件包中的s3curl.pl文件中 ``` vim ./s3curl.pl # begin customizing here my @endpoints = ( 'obs.huawei.com' ); ``` # ak/sk配置 配置文件在s3curl软件包中 ``` cat ./.s3curl %awsSecretAccessKeys = ( # 你的账号配置;名字可以随便起,待会是要用的; test1 => { id => 'CD210CF6BADAE52BF7AE', key => 'yDL5AJ5jwMAAw0pvYMj7rpP9uHEAAAFButrlK5Nf', } ); ``` # 使用说明 ``` To get an object, you would run: ./s3curl.pl --id=[friendly-name] -- http://s3.amazonaws.com/[bucket-name]/[key-name] To put an object, run: ./s3curl --id=bpc2 --put=4Gobject -- http://129.22.69.11:5080/bpc2bucket01/${objectname} -v | xmllint --format - To delete an object: ./s3curl --id=bpc2 --delete -- http://129.22.69.11:5080/bpc2bucket01/${objectname} -v ``` # 官方说明 ``` This script is a wrapper around curl, a popular command line http client, that will calculate the authentication parameters for the request. To start, create an .s3curl file in your home directory. This file will contain your AWS Access Key Id and AWS Secret Access Key pairs. For example: %awsSecretAccessKeys = ( # personal account personal => { id => '1ME55KNV6SBTR7EXG0R2', key => 'zyMrlZUKeG9UcYpwzlPko/+Ciu0K2co0duRM3fhi', }, # corporate account company => { id => '1ATXQ3HHA59CYF1CVS02', key => 'WQY4SrSS95pJUT95V6zWea01gBKBCL6PI0cdxeH8', }, ); After creating the .s3curl file, you can try the following commands using s3curl To get an object, you would run: ./s3curl.pl --id=[friendly-name] -- http://s3.amazonaws.com/[bucket-name]/[key-name] If you just want to see the object's metadata, run: ./s3curl.pl --id=[friendly=name] --head -- http://s3.amazonaws.com/[bucket-name]/[key-name] The arguments after the '--' are passed through to curl, so you could put any curl specific options there, and then the url you are trying to get. To put an object, run: ./s3curl.pl --id=[friendly-name] --put=<file-name> -- http://s3.amazonaws.com/[bucket-name]/[key-name] To delete an object: ./s3curl.pl --id=[friendly-name] --delete -- http://s3.amazonaws.com/[bucket-name]/[key-name] To copy an object: ./s3curl.pl --id=[friendly-name] --copy=[source-bucket-name/source-key-name] -- http://s3.amazonaws.com/[bucket-name]/[key-name] To restore an object (previously archived to Glacier): ./s3curl.pl --id=[friendly-name] --post --data-binary "<RestoreRequest><Days>[number-of-days]</Days></RestoreRequest>" -- http://s3.amazonaws.com/[bucket-name]/[key-name]?restore To list a bucket: ./s3curl.pl --id=[friendly-name] -- http://s3.amazonaws.com/[bucket-name] To create a bucket: ./s3curl.pl --id=[friendly-name] --createBucket -- http://s3.amazonaws.com/[bucket-name] To create a bucket with a location constraint EU: ./s3curl.pl --id=[friendly-name] --createBucket=EU -- http://s3.amazonaws.com/[bucket-name] To delete a bucket: ./s3curl.pl --id=[friendly-name] --delete -- http://s3.amazonaws.com/[bucket-name] To enable versioning for a bucket: ./s3curl.pl --id=[friendly-name] --put ~/versioningEnable -- http://s3.amazonaws.com/[bucket-name]?versioning where, contents of ~/versioningEnable is <?xml version="1.0" encoding="UTF-8"?> <VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Status>Enabled</Status> </VersioningConfiguration> Doing a GET for an object on a bucket where versioning is enabled, returns the latest version. ./s3curl.pl --id=[friendly-name] -- http://s3.amazonaws.com/[bucket-name]/[key-name] -v [Look for x-amz-version-id in the response] To get a specific version of an object: ./s3curl.pl --id=[friendly-name] -- http://s3.amazonaws.com/[bucket-name]/[key-name]?versionId=[version-id] To get a ACL for a specific version of an object: ./s3curl.pl --id=[friendly-name] -- http://s3.amazonaws.com/[bucket-name]/[key-name]?versionId=[version-id]&acl To copy a specific version of an object: ./s3curl.pl --id=[friendly-name] --copy=[source-bucket-name/source-key-name?versionId=[version-id]] -- http://s3.amazonaws.com/[bucket-name]/[key-name] To list all the versions in a bucket: ./s3curl.pl --id=[friendly-name] -- http://s3.amazonaws.com/[bucket-name]?versions SECURITY CONSIDERATION: On a shared system, it is dangerous to specify your AWS Secret Access Key on the command line, as any other user on the machine can view your command line. Therefore we strongly advocate the use of .s3curl file to store and manage your keys. This software code is made available "AS IS" without warranties of any kind. You may copy, display, modify and redistribute the software code either by itself or as incorporated into your code; provided that you do not remove any proprietary notices. Your use of this software code is at your own risk and you waive any claim against Amazon Digital Services, Inc. or its affiliates with respect to your use of this software code. (c) 2006 Amazon Digital Services, Inc. or its affiliates. ```
阿星
2024年1月21日 21:39
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
PDF文档(打印)
分享
链接
类型
密码
更新密码