Copy objects
POST/v1/storages/copy-objects
Note: This interface can only be called by administrators.
Batch copy specified objects to the target path, with optional parameters to control whether to overwrite existing objects with the same name at the target path or delete the original objects after copying.
Request
- application/json
Body
arrayrequired
Batch copy object request parameters, array format
- Array [
- ]
srcPath Absolute path of the source object, including the file name. For example, foo/bar.jpg, foo/bar/baz.jpg, etc. Cannot contain characters other than [0-9, a-z, A-Z], /, !, -, _, ., , *, and Chinese characters (string)required
dstPath Absolute path of the destination object, including the file name. For example, foo/bar.jpg, foo/bar/baz.jpg, etc. Cannot contain characters other than [0-9, a-z, A-Z], /, !, -, _, ., , *, and Chinese characters; the destination path must not be the same as the source path (string)required
overwrite Whether to allow overwriting existing objects when the destination object already exists, default is true (boolean)
Default value: true
removeOriginal Whether to delete the original object after copying, default is false (boolean)
Responses
- 200
- default
Returned when the call is successful
Response Headers
X-Request-Id string
Request ID
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- v1CopyObjectsResponseItemSuccess
- v1CopyObjectsResponseItemError
- ]
oneOf
cloudObjectId Cloud file ID after copying (string)
code Error code returned when the request for this object fails (string)
message Error description returned when the request for this object fails (string)
[
{
"code": "OBJECT_NOT_EXIST",
"message": "Storage object not exists."
},
{
"cloudObjectId": "cloud://your-envId.bucket/file.jpg"
}
]
General error information, see https://docs.cloudbase.net/error-code/service for details
Response Headers
X-Request-Id string
Request ID
- application/json
- Schema
- Example (from schema)
- InvalidHost
Schema
code Error code (string)
message Error message (string)
requestId Request ID (string)
{
"code": "string",
"message": "string",
"requestId": "string"
}
Invalid request address
{
"code": "INVALID_HOST",
"message": "xxx",
"requestId": "xxx"
}
Loading...