FDS Restful API
Copy object related api supported by FDS
Version: 1.0.0
/{dst_bucketname}/{dst_objectname}
PUT
Summary:
将一个src_objectname从src_bucketname复制到dst_bucketname,并重命名为dst_objectname
Description:
只有具有有源Object读权限和目标Object位置写权限的key才可以执行操作
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
dst_bucketname | path | 目标bucket名字 | Yes | string |
dst_objectname | path | 目标object名字 | Yes | string |
cp | query | 标识此请求为copy请求,可以为空 | Yes | string |
authorization | header | 认证信息,计算方式参考签名认证相关文档 | Yes | string |
Date | header | 请求时间 | Yes | string |
body | body | 源Bucket名和源Object名 | Yes | CopyObjectBean |
Responses
Code | Description |
---|---|
200 | 请求成功 |
409 | 已经存在同名的Bucket |
Models
CopyObjectBean
Name | Type | Description | Required |
---|---|---|---|
srcBucketName | string | 源Bucket名字 | No |
srcObjectName | string | 源Object名字 | No |
命令行示例
# Copy object hello/world.txt to dst_bucketname/dst_objectname.txt
curl -v -X 'PUT' 'http://cnbj0.fds.api.xiaomi.com/dst_bucketname/dst_objectname.txt?cp' \
> -H 'content-type: application/json' \
> -H 'authorization: Galaxy-V2 541xxx45:LepxxxmQ=' \
> -H 'date: Mon, 27 Feb 2017 09:40:11 GMT' \
> -d '{"srcBucketName":"hello","srcObjectName":"world.txt"}'
* Trying 10.142.10.45...
* TCP_NODELAY set
* Connected to cnbj0-fds.api.xiaomi.net (10.142.10.45) port 80 (#0)
> PUT /dst_bucketname/dst_objectname.txt?cp HTTP/1.1
> Host: cnbj0-fds.api.xiaomi.net
> User-Agent: curl/7.58.0
> Accept: */*
> content-type: application/json
> authorization: Galaxy-V2 541xxx45:LepxxxmQ=
> date: Mon, 27 Feb 2017 09:40:11 GMT
> Content-Length: 53
>
* upload completely sent off: 53 out of 53 bytes
< HTTP/1.1 200 OK
< Server: Tengine
< Date: Mon, 15 Jul 2019 02:26:51 GMT
< Content-Length: 147
< Connection: keep-alive
< Access-Control-Allow-Origin: *
<
* Connection #0 to host cnbj0.fds.api.xiaomi.com left intact
{"accessKeyId":"54xxx45","bucketName":"dst_bucketname","expires":1490780472318,"objectName":"dst_objectname.txt","signature":"6WxxxQ="}