FDS Restful API

Upload part related api supported by FDS

Version: 1.0.0

/{bucketname}/{objectname}


PUT

Summary: upload a multipart

Description: must first get a legitimate uploadId through the initialization interface

Parameters

Name Located in Description Required Schema
bucketname path Bucket name Yes string
objectname path name of object uploaded Yes string
uploadId query UploadId obtained after initializing multipart uploading Yes string
partNumber query multipart mumber Yes string
authorization header authentication info,The calculation method is referred to the relevant document of signature verification No string
Date header request time Yes string
body body multipart content Yes binary

Responses

Code Description Schema
200 request successfully UploadPartResult

Models


UploadPartResult

Name Type Description Required
partNumber integer multipart number No
etag string multipart ID No
partSize long multipart size No

command line examples

# upload the firt multipart
curl -v -X PUT 'http://cnbj0.fds.api.xiaomi.com/fds-demo/tests/test.txt?uploadId=26287b89-62d7-4527-99ec-41a8fd8794a5&partNumber=1' \
 -H 'content-type: application/octet-stream' \
 -H 'date: Tue, 28 Feb 2017 02:50:54 GMT' \
 --data-binary @./part1
> PUT /fds-demo/tests/test.txt?uploadId=26287b89-62d7-4527-99ec-41a8fd8794a5&partNumber=1 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: 10245760
> Expect: 100-continue
> 
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
* Server Tengine is not blacklisted
< Server: Tengine
< Date: Tue, 28 Feb 2017 03:18:40 GMT
< Content-Type: application/json
< Content-Length: 78
< 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
{"etag":"a0a64b39f67c9bb4d98556454541c2b7","partNumber":1,"partSize":10245760}
# upload the second multipart
curl -v -X PUT 'http://cnbj0.fds.api.xiaomi.com/fds-demo/tests/test.txt?uploadId=26287b89-62d7-4527-99ec-41a8fd8794a5&partNumber=2' \
 -H 'content-type: application/octet-stream' \
 -H 'date: Tue, 28 Feb 2017 02:50:54 GMT' \
 --data-binary @./part2
> PUT /fds-demo/tests/test.txt?uploadId=26287b89-62d7-4527-99ec-41a8fd8794a5&partNumber=2 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: 5
> 
* upload completely sent off: 5 out of 5 bytes
< HTTP/1.1 200 OK
* Server Tengine is not blacklisted
< Server: Tengine
< Date: Tue, 28 Feb 2017 03:05:11 GMT
< Content-Type: application/json
< Content-Length: 71
< 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
{"etag":"0d599f0ec05c3bda8c3b8a68c32a1b47","partNumber":2,"partSize":5}

results matching ""

    No results matching ""