1.28.18 list-bucket

优质
小牛编辑
124浏览
2023-12-01

ListBuckets related api supported by FDS

Version: 1.0.0

/

GET

Summary:

获取创建的Bucket列表

Description:
Parameters
NameLocated inDescriptionRequiredSchema
authorizationheader认证信息,计算方式参考签名认证相关文档Yesstring
Dateheader请求时间Yesstring
authorizedBucketsquery如果包含这个请求参数,返回的bucket列表里包含所有被授权的bucketNostring
Responses
CodeDescriptionSchema
200bucket列表ListAllBucketsResult

Models

ListAllBucketsResult

NameTypeDescriptionRequired
ownerOwnerBeanNo
buckets[ BucketBean ]No

OwnerBean

拥有者信息

NameTypeDescriptionRequired
idstring拥有者IDNo
displayNamestring拥有者名字No

BucketBean

bucket信息

NameTypeDescriptionRequired
namestringbucket名字No
orgIdstring拥有者IDNo

命令行示例

# 1. 列出所有自己创建的Bucket
curl -v -XGET\
    -H 'authorization: Galaxy-V2 54xxxxxx45:NgxxxxxxxxxDWI=' \
    -H 'Date: Mon, 20 Feb 2017 03:21:04 GMT' \
    'https://cnbj0.fds.api.xiaomi.com'
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: cnbj0.fds.api.xiaomi.com
> Accept: */*
> authorization: Galaxy-V2 54xxxxxx45:NgxxxxxxxxxDWI=
> Date: Mon, 20 Feb 2017 03:21:04 GMT
> 
< HTTP/1.1 200 OK
* Server Tengine is not blacklisted
< Server: Tengine
< Date: Mon, 20 Feb 2017 03:24:12 GMT
< Content-Type: application/json
< Content-Length: 1609
< 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
< 
{"buckets":[{"creationTime":0,"name":"fds-demo","numObjects":0,"orgId":"180835","usedSpace":0}],"owner":{"id":"180835"}}
# 2. 列出所有被授权的Bucket,输出格式同上
curl -v -XGET\
    -H 'authorization: Galaxy-V2 54xxxxxx45:Fgxxxxxxxxxx=' \
    -H 'Date: Mon, 20 Feb 2017 03:21:04 GMT' \
    'https://cnbj0.fds.api.xiaomi.com?authorizedBuckets'