FDS Restful API
Complete multipart upload related api supported by FDS
Version: 1.0.0
/{bucketname}/{objectname}
PUT
Summary: multpart upload complete
Description: combine all the parts to be an Object
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
bucketname | path | Bucket name | Yes | string |
objectname | path | Object name | Yes | string |
Date | header | request time | Yes | string |
uploadId | query | uploadId gained when initializing multipart upload | Yes | string |
expires | query | if uploading successfully,the expired timestamp of signature(UTC),time unit is ms,default 30 days | No | string |
content-type | header | object的content-type | No | string |
body | body | list of multiparts needed to be combined | Yes |
Responses
Code | Description | Schema |
---|---|---|
200 | request successfully | PutObjectResult |
Models
Name | Type | Description | Required |
---|---|---|---|
bucketname | string (int32) | Bucket name | No |
objectName | string | Object name | No |
accessKeyId | string | accessKeyId used for signature | No |
signature | string | signature used to download the Object | No |
expires | strin | expired timestamp of signature(UTC),time unit is ms, default 30 days | No |
Name | Type | Description | Required |
---|---|---|---|
partNumber | integer | multipart number | No |
etag | string | multipart ID | No |
partSize | long | multipart size | No |
command line examples
curl -v -X PUT 'http://cnbj0.fds.api.xiaomi.com/fds-demo/tests/test.txt?uploadId=26287b89-62d7-4527-99ec-41a8fd8794a5' -H 'content-type: application/octet-stream' -H 'date: Tue, 28 Feb 2017 02:50:54 GMT' -d '{"uploadPartResultList":[{"etag":"a0a64b39f67c9bb4d98556454541c2b7","partNumber":1,"partSize":10245760}, {"etag":"0d599f0ec05c3bda8c3b8a68c32a1b47","partNumber":2,"partSize":5}]}'
* 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/tests/test.txt?uploadId=26287b89-62d7-4527-99ec-41a8fd8794a5 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: cnbj0.fds.api.xiaomi.com
> Accept: */*
> content-type: application/octet-stream
> date: Tue, 28 Feb 2017 02:50:54 GMT
> Content-Length: 178
>
* upload completely sent off: 178 out of 178 bytes
< HTTP/1.1 200 OK
* Server Tengine is not blacklisted
< Server: Tengine
< Date: Tue, 28 Feb 2017 03:20:08 GMT
< Content-Type: application/json
< Content-Length: 152
< 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
{"accessKeyId":"515xxx01","bucketName":"fds-demo","expires":1490844007182,"objectName":"tests/test.txt","signature":"rLSehxxxxM="}
# download files using the returned accessKey and signature
curl -v -X GET 'http://cnbj0.fds.api.xiaomi.com/fds-demo/tests/test.txt?signature=rLSehxxxxM=&accessKeyId=515xxx01'
* 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/tests/test.txt?signature=MTexxxAl4=&accessKeyId=541xxx045 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: cnbj0.fds.api.xiaomi.com
> Accept: */*
>
< HTTP/1.1 200 OK
* Server Tengine is not blacklisted
< Server: Tengine
< Date: Thu, 02 Mar 2017 06:20:51 GMT
< Content-Type: application/octet-stream
< Content-Length: 5
< Connection: keep-alive
< last-modified: Thu, 02 Mar 2017 06:18:29 GMT
< x-xiaomi-meta-acl: PUBLIC_READ
< content-md5: 0d599f0ec05c3bda8c3b8a68c32a1b47
< Cache-Control: max-age=86400
< 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
<
...
# content of the files