doc-exports/docs/obs/api-swift/obs_03_0065.html
zhangyue 894279c39a Object Storage Service API Reference Swift V1
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2023-02-02 08:50:48 +00:00

37 lines
2.5 KiB
HTML

<a name="obs_03_0065"></a><a name="obs_03_0065"></a>
<h1 class="topictitle1">Examples</h1>
<div id="body1442649345348"><div class="section" id="obs_03_0065__section2201390"><h4 class="sectiontitle">Use COPY Command to Copy Object</h4><p id="obs_03_0065__p61892272161737">Use the COPY command to copy an object. In this example, the source object is <strong id="obs_03_0065__b84235270616412">janeausten/goodby</strong> and the destination object is <strong id="obs_03_0065__b84235270616424">marketwain/goodbye</strong>.</p>
</div>
<pre class="codeblock" id="obs_03_0065__codeblock1784592711126">curl -i http://172.28.54.12:80/v1/AUTH_4b34aa268d8c45879cf4da16443d3f95/marketwain/goodbye -H "X-Auth-Token:74565091b56b4783818430cecb283e7f" -XCOPY -H "Destination:janeausten/goodbye"</pre>
<pre class="screen" id="obs_03_0065__screen1268254511131">HTTP/1.1 201 Created
X-Trans-Id: tx000001513c9e87a1370c0-144543b5de
Content-Type: text/html;charset=UTF-8
Date: Wed, 25 Nov 2015 03:10:01 GMT
ETag: e85f5c28b588fa64a379ba876e3591d2
Last-Modified: Wed, 25 Nov 2015 03:10:01 GMT
X-Copied-From: marketwain/goodbye
X-Copied-From-Account: AUTH_4b34aa268d8c45879cf4da16443d3f95
X-Copied-From-Last-Modified: Wed, 25 Nov 2015 03:04:55 GMT
Content-Length: 0</pre>
<div class="section" id="obs_03_0065__section60098234144536"><h4 class="sectiontitle">Use PUT Command to Copy Object</h4><p id="obs_03_0065__p48068385162043">Use the PUT command to copy an object. In this example, the source object is <strong id="obs_03_0065__b1569708018">janeausten/goodby</strong> and the destination object is <strong id="obs_03_0065__b69734113">marketwain/goodbye</strong>.</p>
<pre class="codeblock" id="obs_03_0065__codeblock104082111825">curl -i http://172.28.54.12:80/v1/AUTH_4b34aa268d8c45879cf4da16443d3f95/janeausten/goodbye -H "X-Auth-Token:74565091b56b4783818430cecb283e7f" -H "X-Copy-from:/marketwain/goodbye" -XPUT -H "Content-Length:0"</pre>
</div>
<pre class="screen" id="obs_03_0065__screen22016537111849">HTTP/1.1 201 Created
X-Trans-Id: tx000001513ca34816370c1-16ea772e65
Content-Type: text/html;charset=UTF-8
Date: Wed, 25 Nov 2015 03:15:12 GMT
ETag: e85f5c28b588fa64a379ba876e3591d2
Last-Modified: Wed, 25 Nov 2015 03:15:12 GMT
X-Copied-From: marketwain/goodbye
X-Copied-From-Account: AUTH_4b34aa268d8c45879cf4da16443d3f95
X-Copied-From-Last-Modified: Wed, 25 Nov 2015 03:04:55 GMT
Content-Length: 0</pre>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_03_0062.html">Copy Object</a></div>
</div>
</div>