天翼云对象存储(经典版)I型API参考-GET Bucket (List Objects) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
产品推荐: 1、安全稳定的云服务器租用,2核/2G/5M仅37元,点击抢购>>>; 2、高防物理服务器20核/16G/50M/500G防御仅350元,点击抢购>>> 3、百度智能建站(五合一网站)仅880元/年,点击抢购>>> 模板建站(PC+手机站)仅480元/年,点击抢购>>> 4、阿里云服务器2核2G3M仅99元/年、2核4G5M仅199元/年,新老同享,点击抢购>>> 5、腾讯云服务器2核2G4M仅99元/年、新老同享,点击抢购>>> 点击这里注册天翼云特邀VIP帐号,立即体验天翼云对象存储>>> 天翼云对象存储(经典版)I型API参考-GET Bucket (List Objects) 此操作用来返回Bucket中部分或者全部(最多1000)的Object信息。用户可以在请求元素中设置选择条件来获取Bucket中的Object的子集。 请求语法
请求参数
响应结果
请求示例1GET / HTTP/1.1 Host: test0304.oos-cn.ctyunapi.cn x-amz-content-sha256: UNSIGNED-PAYLOAD Authorization: AWS4-HMAC-SHA256 Credential=58c5d7df73fdcb78fe92/20200304/cn-180622/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=aef077644b2ea50fa69f9787ab025be99ae41c9923411ccc2db2a2ff725f0ffb X-Amz-Date: 20200304T070632Z Content-Type: application/xml; charset=utf-8 响应示例1HTTP/1.1 200 OK Date: Wed, 04 Mar 2020 07:06:40 GMT x-amz-request-id: b13be3abf4db4af33eaaaeb5bdb5b7bd7c7e82727476787a7c Content-Length: 538 Content-Type: application/xml; charset=utf-8 Server: CTYUN <?xml version="1.0" encoding="UTF-8"?> <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Name>test0304</Name> <Prefix></Prefix> <Marker></Marker> <MaxKeys>1000</MaxKeys> <EncodingType></EncodingType> <IsTruncated>false</IsTruncated> <Contents> <Key>1.png</Key> <LastModified>2020-03-04T07:04:48.135Z</LastModified> <ETag>"01fa001a4c65b834696c5e0049fd5004"</ETag> <Size>25348</Size> <StorageClass>STANDARD</StorageClass> <Owner> <ID></ID> <DisplayName></DisplayName> </Owner> </Contents> </ListBucketResult> 请求示例2假设数据库中存储数据如下所示: doc/sample.pdf doc/Ant/sample.doc doc/Feb/sample2.doc doc/Feb/sample3.doc doc/Feb/sample4.doc 要查询prefix为doc/,delimiter为/,同时marker为doc/F,max-keys为40的结果,请求头为 GET /?prefix=doc/&marker=doc/F&max-keys=40&delimiter=/ HTTP/1.1 Host: doc.oos-cn.ctyunapi.cn Date: Mon, 03 Sep 2012 12:00:00 GMT Authorization: AWS 81ebc16ddc8d2af82c90:thdUi9VAkzhkniLj96JIrOPGi0g 响应示例2<ListBucketResult xmlns="http://oos-cn.ctyunapi.cn/doc/2012-09-03/"> <Name>doc</Name> <Prefix>doc/</Prefix> <Marker>doc/F</Marker> <MaxKeys>40</MaxKeys> <Delimiter>/</Delimiter> <IsTruncated>false</IsTruncated> <Contents> <Key>sample.pdf</Key> <LastModified>2012-09-01T01:56:20.000Z</LastModified> <ETag>"bf1d737a4d46a19f3bced6905cc8b902"</ETag> <Size>142863</Size> <Owner> <ID> </ID> <DisplayName> </DisplayName> </Owner> <StorageClass>STANDARD</StorageClass> </Contents> <CommonPrefixes> <Prefix>Feb/</Prefix> <Prefix>Ant/</Prefix> </CommonPrefixes> </ListBucketResult> |