FDS Restful API
Create Bucket related api supported by FDS
Version: 1.0.0
/{bucketname}
PUT
Summary: create Bucket
Description: There are Quota limits for the number of buckets created, please refer to the FAQ for details
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
bucketname | path | bucket name | Yes | 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 |
x-xiaomi-meta-acl | header | specify Bucket permission, value including PUBLIC_READ , PUBLIC_WRITE , PUBLIC_READ_OBJECTS , AUTHENTICATED_READ , AUTHENTICATED_WRITE ,AUTHENTICATED_READ_OBJECTS , use , to seperate the values |
No | string |
Responses
Code | Description |
---|---|
200 | request successfully |
409 | exist Buckets with same name |
command line examples
# create a bucked named fds-demo
curl -v -X 'PUT' 'cnbj0.fds.api.xiaomi.com/fds-demo' \
-H 'content-type: application/json; charset=UTF-8' \
-H 'authorization: Galaxy-V2 541xxxxx45:rvxxxxxY=' \
-H 'date: Wed, 22 Feb 2017 07:30:01 GMT' \
-d '"{}"'
* 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)
> PUT /fds-demo HTTP/1.1
> User-Agent: curl/7.35.0
> Host: cnbj0.fds.api.xiaomi.com
> Accept: */*
> content-type: application/json; charset=UTF-8
> authorization: Galaxy-V2 541xxxxx45:rvxxxxxY=
> date: Wed, 22 Feb 2017 07:30:01 GMT
> Content-Length: 4
>
* upload completely sent off: 4 out of 4 bytes
< HTTP/1.1 200 OK
* Server Tengine is not blacklisted
< Server: Tengine
< Date: Wed, 22 Feb 2017 07:30:34 GMT
< Content-Length: 0
< 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
# when creating a Bucket, Set the bucket for all to read through x-xiaomi-meta-acl's header.
curl -v -X 'PUT' 'http://cnbj0.fds.api.xiaomi.com/fds-demo' \
-H 'content-type: application/json; charset=UTF-8' \
-H 'authorization: Galaxy-V2 54xxxxx45:9Gxxx9A=' \
-H 'x-xiaomi-meta-acl: PUBLIC_READ, PUBLIC_WRITE' \
-H 'date: Wed, 22 Feb 2017 09:04:36 GMT' \
-d '"{}"'
* 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)
> PUT /fds-demo HTTP/1.1
> User-Agent: curl/7.35.0
> Host: cnbj0.fds.api.xiaomi.com
> Accept: */*
> content-type: application/json; charset=UTF-8
> authorization: Galaxy-V2 Galaxy-V2 54xxxxx45:9Gxxx9A=
> x-xiaomi-meta-acl: PUBLIC_READ, PUBLIC_WRITE
> date: Wed, 22 Feb 2017 09:04:36 GMT
> Content-Length: 4
>
* upload completely sent off: 4 out of 4 bytes
< HTTP/1.1 200 OK
* Server Tengine is not blacklisted
< Server: Tengine
< Date: Wed, 22 Feb 2017 09:05:42 GMT
< Content-Length: 0
< 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