Copy object COPY /v1/{account}/{container}/{object}

Copies an object.

This is the same as using PUT and specifying X-Copy-From.

When this operation is used to copy a manifest object, the new object becomes a normal object with all segments joined. Therefore, it is not possible to copy an object that has a combined size exceeding 5 GB.

The same metadata as that of the copy source object is assigned. If metadata is specified when making a request, the metadata of the copy destination object will be updated after copying is done.

When creation of an object is successful, the 201 Created status code is returned.

CAUTION:
The object storage is in state in which a number of replicas exist, based on Eventual Consistency, and the COPY operation is performed with the latest replica selected. In other words, when COPY is used, this performs the same operation as when the X-Newest header is used.

Request headers

X-Auth-Token

Authentication token

Data Type Cardinality
String 1..1

Destination

Specify the copy destination container name and object name using the /{container}/{object} format. Also, it is necessary for the container name and object name to be UTF-8-encoded as well as URL-encoded before being set in the header.

Data Type Cardinality
String 1..1

Content-Type

MIME type of an object

Data Type Cardinality
String 0..1

Content-Encoding

Sets the Content-Encoding metadata.

Data Type Cardinality
String 0..1

Content-Disposition

Sets the browser behavior.

Refer to "http://www.ietf.org/rfc/rfc2183.txt" for details on the value to set.

Data Type Cardinality
String 0..1

X-Object-Meta-name

Object metadata {name} is the name of the metadata item.

Data Type Cardinality
String 0..1

Request Parameter

{account}

Name uniquely assigned by project

Data Type Cardinality
String 1..1

{container}

Container name

Data Type Cardinality
String 1..1

{object}

Object name

Data Type Cardinality
String 1..1

Response Headers

X-Copied-From-Last-Modified

Last modified datetime of copy source object

Data Type Cardinality
String 0..1

X-Copied-From

Container name and object name of copy source object. This is returned using the {container}/{object} format.

Data Type Cardinality
String 0..1

Last-Modified

Datetime when an object was created, or the datetime when the metadata was modified

Data Type Cardinality
String 1..1

ETag

MD5 checksum of an object. This value is not to be enclosed in quotation marks.

Data Type Cardinality
String 1..1

Content-Type

MIME type of an object

Data Type Cardinality
String 1..1

X-Object-Meta-name

Object metadata {name} is the name of the metadata item.

Data Type Cardinality
String 0..

X-Trans-Id

ID assigned to this request. This is used when inquiring about issues.

Data Type Cardinality
Uuid 1..1

Date

Datetime when the transaction was executed

Data Type Cardinality
Datetime 1..1

Response Elements

None

COPY

Example of Request


       curl -i $publicURL/marktwain/goodbye -X COPY -H "X-Auth-Token:$token" -H "Destination: janeausten/goodbye"
     

Example of Response


HTTP/1.1 201 Created
Content-Length: 0
X-Copied-From-Last-Modified: Thu, 16 Jan 2014 21:19:45 GMT
X-Copied-From: marktwain/goodbye
Last-Modified: Fri, 17 Jan 2014 18:22:57 GMT
Etag: 451e372e48e0f6b1114fa0724aa79fa1
Content-Type: text/html; charset=UTF-8
X-Object-Meta-Movie: AmericanPie
X-Trans-Id: txdcb481ad49d24e9a81107-0052d97501
Date: Fri, 17 Jan 2014 18:22:57 GMT
     

Note: When copying using a "X-Copy-From" header with PUT

Example of Request


curl -i $publicURL/janeausten/goodbye -X PUT -H "X-Auth-Token: $token" -H "X-Copy-From: /marktwain/goodbye" -H "Content-Length: 0"
     

Example of Response


HTTP/1.1 201 Created
Content-Length: 0
X-Copied-From-Last-Modified: Thu, 16 Jan 2014 21:19:45 GMT
X-Copied-From: marktwain/goodbye
Last-Modified: Fri, 17 Jan 2014 18:22:57 GMT
Etag: 451e372e48e0f6b1114fa0724aa79fa1
Content-Type: text/html; charset=UTF-8
X-Object-Meta-Movie: AmericanPie
X-Trans-Id: txdcb481ad49d24e9a81107-0052d97501
Date: Fri, 17 Jan 2014 18:22:57 GMT