FDS Restful API
List objects related api supported by FDS
Version: 1.0.0
/{bucketname}
GET
Summary: get object list under bucket
Description: must have READ
permission of the bucket, The returned result may be paged, requiring multiple calls to get the full list; The server returns the Object by name to the client
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
bucketname | path | bucket name | Yes | string |
prefix | query | prefix of the object names that need to list | Yes | string |
delimiter | query | Please refer to the detailed examples for specific use.if delimieter is not void, and prefix is not an empty string, then prefix must end with delimiter | No | string |
marker | query | Get interface from the previous call to the list-objects,the format is similar to stringbucket_name/start_object_name ,the returned object dictionary sequences are not less than strat_object_name |
No | string |
maxKeys | query | Specify the number of objects to be returned at most, and the server will return min(maxKeys, 1000) objects at most, and possibly less. | No | string |
authorization | header | authentication info,The calculation method is referred to the relevant document of signature verification | Yes | string |
Date | header | request time | Yes | string |
Responses
Code | Description | Schema |
---|---|---|
200 | request successfully | ListObjectsResult |
Models
Name | Type | Description | Required |
---|---|---|---|
name | string | Bucket name | No |
prefix | string | The prefix specified in the call | No |
maxKeys | string | The maxKeys specified in the call | No |
marker | string | The marker specified in the call | No |
truncated | boolean | if the result is paginated,if true,indicate that Object that has a larger dictionary order under the bucket is not returned | No |
nextMarker | string | if truncated is true,indicate the next call needs to specify the request parameter marker values |
No |
objects | [ ObjectBean ] | object list | No |
commonPrefixes | [ string ] | If a call specifies the delimiter parameters,then FDS will use delimiter as a seperator to sperate the object names,and use the prefix of all parts expect the last one after seperation as dictionary , commonPrefixes saved all dictionary uder current prefix |
No |
delimiter | string | delimiter parameter when calling | No |
Name | Type | Description | Required |
---|---|---|---|
name | string | object name | No |
owner | OwnerBean | No | |
uploadTime | long | upload timestamp(UTC),unit is ms | No |
size | long | file's size | No |
Name | Type | Description | Required |
---|---|---|---|
id | string | owner ID | No |
command line examples
# list all the objects under fds-demo
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}
# list all the objects under fds-demo,use'/' as separator
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}
# Return 2 records at most
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 the remaining object following the last time
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}