- 1.3 FDS简介
- 1.4 基本概念
- 1.5 使用场景
- 1.6 快速入门
- 1.6.1 帐号注册
- 1.6.2 创建Bucket
- 1.6.3 上传文件
- 1.6.4 生成文件预签名链接
- 1.6.5 为云服务密钥授权
- 1.6.6 通过SDK下载文件
- 1.7 请求认证
- 1.7.1 OAuth认证
- 1.7.2 签名认证
- 1.7.3 预签名认证
- 1.8 权限列表
- 1.9 Presigned URL
- 1.10 SDK
- 1.10.1 Service操作API的签名和示例
- 1.10.2 Bucket操作API的签名和示例
- 1.10.3 Object操作API的签名和示例
- 1.11 Service操作REST API
- 1.11.1 List Buckets
- 1.12 Bucket操作REST API
- 1.12.1 PUT Bucket
- 1.12.2 DELETE Bucket
- 1.12.3 HEAD Bucket
- 1.12.4 PUT Bucket ACL
- 1.12.5 GET Bucket META
- 1.12.6 GET Bucket ACL
- 1.12.7 List Objects
- 1.13 Object操作 REST API
- 1.13.1 Put Object
- 1.13.2 POST Object
- 1.13.3 GET Object
- 1.13.4 HEAD Object
- 1.13.5 Copy Object
- 1.13.6 PUT Object ACL
- 1.13.7 GET Object ACL
- 1.13.8 GET Object metadata
- 1.13.9 DELETE Object
- 1.13.10 Delete multiple Objects
- 1.13.11 DELETE Object ACL
- 1.13.12 Restore Object
- 1.13.13 Rename Object
- 1.13.14 Prefetch Object
- 1.13.15 Refresh Object
- 1.13.16 Init multipart upload
- 1.13.17 Upload part
- 1.13.18 Complete multipart-upload
- 1.13.19 Abort multipart upload
- 1.14 CDN使用
- 1.15 服务端加密
- 1.16 图像处理
- 1.17 计量计费
- 1.18 分片上传
- 1.19 误删数据恢复
- 1.20 TTL功能
- 1.21 跨域资源共享(CORS)
- 1.22 FDS命令行工具
- 1.23 FDS第三方迁移工具
- 1.24 FDS存量数据加密工具
- 1.25 FAQ
- 1.26 问题调查
- 1.27 问题反馈
- 1.28.1 abort-multipart-upload
- 1.28.2 complete-multipart-upload
- 1.28.3 delete-bucket
- 1.28.4 delete-multiple-objects
- 1.28.5 delete-object-acl
- 1.28.6 delete-object
- 1.28.7 delete-objects
- 1.28.8 get-bucket-acl
- 1.28.9 get-bucket-meta
- 1.28.10 get-endpoint
- 1.28.11 get-object-acl
- 1.28.12 get-object
- 1.28.13 copy-object
- 1.28.14 get-object-metadata
- 1.28.15 head-bucket
- 1.28.16 head-object
- 1.28.17 init-multipart-upload
- 1.28.18 list-bucket
- 1.28.19 list-objects
- 1.28.20 OAuth
- 1.28.21 post-object
- 1.28.22 prefetch-object
- 1.28.23 put-bucket-acl
- 1.28.24 put-bucket
- 1.28.25 put-object-acl
- 1.28.26 put-object
- 1.28.27 rename-object
- 1.28.28 refresh-object
- 1.28.29 restore-object
- 1.28.30 upload-part
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
1.28.19 list-objects
List objects related api supported by FDS
Version: 1.0.0
/{bucketname}
GET
Summary:
获取某个Bucket下的Object列表
Description:
需要有Bucket的READ
权限,返回的结果可能被分页,需要多次调用才能获取完整列表;服务端将Object按名字的字典返回给客户端
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
bucketname | path | bucket名字 | Yes | string |
prefix | query | 需要列出的Object名的前缀 | Yes | string |
delimiter | query | 具体使用请参考详细的例子。如果delimieter不是空,且prefix不是空字符串,那么prefix必须以delimiter为结尾 | No | string |
marker | query | 通过之前一次调用list-objects接口获取;格式类似字符串bucket_name/start_object_name ,返回的object字典序都不比strat_object_name小 | No | string |
maxKeys | query | 指定最多返回的Object数量,服务端最多返回min(maxKeys, 1000)个object,可能更少 | No | string |
authorization | header | 认证信息,计算方式参考签名认证相关文档 | Yes | string |
Date | header | 请求时间 | Yes | string |
Responses
Code | Description | Schema |
---|---|---|
200 | 请求成功 | ListObjectsResult |
Models
ListObjectsResult
Name | Type | Description | Required |
---|---|---|---|
name | string | Bucket的名字 | No |
prefix | string | 调用时指定的prefix | No |
maxKeys | string | 调用时指定的maxKeys | No |
marker | string | 调用时指定的marker | No |
truncated | boolean | 结果是否被分页,如果是true,表示bucket下还有字典序更大的满足条件的Object没有被返回 | No |
nextMarker | string | 如果truncated是true,表示下次一次调用需要指定的请求参数marker 的值 | No |
objects | [ ObjectBean ] | object列表 | No |
commonPrefixes | [ string ] | 如果调用时指定了delimiter 参数,那么FDS会把delimiter 作为分割符分割object的名字,并且把分割后除了最后一部分外的各段前缀作为目录 ,commonPrefixes保存了当前prefix下的所有目录 。 | No |
delimiter | string | 调用时传入的delimiter参数 | No |
ObjectBean
Name | Type | Description | Required |
---|---|---|---|
name | string | object名字 | No |
owner | OwnerBean | No | |
uploadTime | long | 上传时间戳(UTC),单位毫秒 | No |
size | long | 文件大小 | No |
OwnerBean
Name | Type | Description | Required |
---|---|---|---|
id | string | 拥有者ID | No |
命令行示例
# 列出fds-demo下的所有Object
curl -v -X 'GET' 'http://cnbj0.fds.api.xiaomi.com/fds-demo?delimiter=%2F&prefix=' \
> -H 'authorization: Galaxy-V2 54xxx45:s8xxx1As=' \
> -H 'date: Fri, 24 Feb 2017 07:30:09 GMT'
* Hostname was NOT found in DNS cache
* Trying 111.206.200.99...
* Connected to cnbj0.fds.api.xiaomi.com (111.206.200.99) port 80 (#0)
> GET /fds-demo?delimiter=%2F&prefix= HTTP/1.1
> User-Agent: curl/7.35.0
> Host: cnbj0.fds.api.xiaomi.com
> Accept: */*
> authorization: Galaxy-V2 54xxx45:s8xxxAs=
> date: Fri, 24 Feb 2017 07:30:09 GMT
>
< HTTP/1.1 200 OK
* Server Tengine is not blacklisted
< Server: Tengine
< Date: Fri, 24 Feb 2017 07:30:47 GMT
< Content-Type: application/json
< Content-Length: 211
< Connection: keep-alive
< Access-Control-Allow-Credentials: true
< Access-Control-Max-Age: 1728000
< Access-Control-Allow-Methods: GET, POST, PUT, HEAD, DELETE, OPTIONS
< Access-Control-Allow-Headers: DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,Content-MD5
< Access-Control-Expose-Headers: content-md5, upload-time, x-xiaomi-meta-content-length
<
* Connection #0 to host cnbj0.fds.api.xiaomi.com left intact
{"commonPrefixes":["bar/","foo/"],"delimiter":"/","marker":"","maxKeys":1000,"name":"fds-demo","objects":[{"name":"bee","owner":{"id":"18xx35"},"size":0,"uploadTime":1487921139433}],"prefix":"","truncated":false}
# 列出fds-demo下的Object,把 '/' 作为分割符
curl -v -X 'GET' 'http://cnbj0.fds.api.xiaomi.com/fds-demo?delimiter=%2F&prefix=' \
> -H 'authorization: Galaxy-V2 54xxx45:rrxx9g=' \
> -H 'date: Fri, 24 Feb 2017 08:36:27 GMT'
* Hostname was NOT found in DNS cache
* Trying 111.206.200.99...
* Connected to cnbj0.fds.api.xiaomi.com (111.206.200.99) port 80 (#0)
> GET /fds-demo?delimiter=%2F&prefix= HTTP/1.1
> User-Agent: curl/7.35.0
> Host: cnbj0.fds.api.xiaomi.com
> Accept: */*
> authorization: Galaxy-V2 54xxx45:rrxx9g=
> date: Fri, 24 Feb 2017 08:36:27 GMT
>
< HTTP/1.1 200 OK
* Server Tengine is not blacklisted
< Server: Tengine
< Date: Fri, 24 Feb 2017 08:36:57 GMT
< Content-Type: application/json
< Content-Length: 211
< Connection: keep-alive
< Access-Control-Allow-Credentials: true
< Access-Control-Max-Age: 1728000
< Access-Control-Allow-Methods: GET, POST, PUT, HEAD, DELETE, OPTIONS
< Access-Control-Allow-Headers: DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,Content-MD5
< Access-Control-Expose-Headers: content-md5, upload-time, x-xiaomi-meta-content-length
<
* Connection #0 to host cnbj0.fds.api.xiaomi.com left intact
{"commonPrefixes":["bar/","foo/"],"delimiter":"/","marker":"","maxKeys":1000,"name":"fds-demo","objects":[{"name":"bee","owner":{"id":"18xx35"},"size":0,"uploadTime":1487921139433}],"prefix":"","truncated":false}
# 最多返回2条记录
curl -v -X 'GET' 'http://cnbj0.fds.api.xiaomi.com/fds-demo?delimiter=%2F&prefix=&maxKeys=2' \
> -H 'authorization: Galaxy-V2 54xxx45:YcxxxU=' \
> -H 'date: Fri, 24 Feb 2017 08:42:01 GMT'
* Hostname was NOT found in DNS cache
* Trying 111.206.200.99...
* Connected to cnbj0.fds.api.xiaomi.com (111.206.200.99) port 80 (#0)
> GET /fds-demo?delimiter=%2F&prefix=&maxKeys=2 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: cnbj0.fds.api.xiaomi.com
> Accept: */*
> authorization: Galaxy-V2 54xxx45:YcxxxU=
> date: Fri, 24 Feb 2017 08:42:01 GMT
>
< HTTP/1.1 200 OK
* Server Tengine is not blacklisted
< Server: Tengine
< Date: Fri, 24 Feb 2017 08:43:02 GMT
< Content-Type: application/json
< Content-Length: 153
< Connection: keep-alive
< Access-Control-Allow-Credentials: true
< Access-Control-Max-Age: 1728000
< Access-Control-Allow-Methods: GET, POST, PUT, HEAD, DELETE, OPTIONS
< Access-Control-Allow-Headers: DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,Content-MD5
< Access-Control-Expose-Headers: content-md5, upload-time, x-xiaomi-meta-content-length
<
* Connection #0 to host cnbj0.fds.api.xiaomi.com left intact
{"commonPrefixes":["bar/"],"delimiter":"/","marker":"","maxKeys":2,"name":"fds-demo","nextMarker":"fds-demo/bee","objects":[],"prefix":"","truncated":true}
# 接着上一次继续list剩余的object
curl -v -X 'GET' 'http://cnbj0.fds.api.xiaomi.com/fds-demo?delimiter=%2F&marker=fds-demo%2Fbee&prefix=&maxKeys=2' \
> -H 'authorization: Galaxy-V2 54xxx45:7HxxxQ=' \
> -H 'date: Fri, 24 Feb 2017 08:45:22 GMT'
* Hostname was NOT found in DNS cache
* Trying 111.206.200.99...
* Connected to cnbj0.fds.api.xiaomi.com (111.206.200.99) port 80 (#0)
> GET /fds-demo?delimiter=%2F&marker=fds-demo%2Fbee&prefix=&maxKeys=2 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: cnbj0.fds.api.xiaomi.com
> Accept: */*
> authorization: Galaxy-V2 54xxx45:7HxxxQ=
> date: Fri, 24 Feb 2017 08:45:22 GMT
>
< HTTP/1.1 200 OK
* Server Tengine is not blacklisted
< Server: Tengine
< Date: Fri, 24 Feb 2017 08:45:51 GMT
< Content-Type: application/json
< Content-Length: 239
< Connection: keep-alive
< Access-Control-Allow-Credentials: true
< Access-Control-Max-Age: 1728000
< Access-Control-Allow-Methods: GET, POST, PUT, HEAD, DELETE, OPTIONS
< Access-Control-Allow-Headers: DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,Content-MD5
< Access-Control-Expose-Headers: content-md5, upload-time, x-xiaomi-meta-content-length
<
* Connection #0 to host cnbj0.fds.api.xiaomi.com left intact
{"commonPrefixes":["foo/"],"delimiter":"/","marker":"fds-demo/bee","maxKeys":2,"name":"fds-demo","nextMarker":"fds-demo/foo0","objects":[{"name":"bee","owner":{"id":"18xx35"},"size":0,"uploadTime":1487921139433}],"prefix":"","truncated":true}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论