doc-exports/docs/obs/api-ref/obs_04_0094.html
zhangyue 7d2a7ec198 OBS API DOC
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2024-11-05 16:37:11 +00:00

89 lines
7.1 KiB
HTML

<a name="obs_04_0094"></a><a name="obs_04_0094"></a>
<h1 class="topictitle1">Renaming an Object</h1>
<div id="body1541665569463"><div class="section" id="obs_04_0094__section83041644183813"><h4 class="sectiontitle">Functions</h4><p id="obs_04_0094__p572355211381">This operation can rename an object.</p>
<div class="note" id="obs_04_0094__note162121231711"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_04_0094__p290817918540">This API is supported only by parallel file systems. For details about how to create a parallel file system, see <a href="obs_04_0021.html#obs_04_0021__section4293341135610">Sample Request: Creating a Parallel File System</a>. Renaming an object is a non-idempotent operation.</p>
</div></div>
</div>
<div class="section" id="obs_04_0094__section760614963314"><h4 class="sectiontitle">Request Syntax</h4><pre class="screen" id="obs_04_0094__screen1061584913333">POST /ObjectName?name=<em id="obs_04_0094__i11871159510">Name&amp;</em>rename HTTP/1.1
Host: <em id="obs_04_0094__i123441746202313">bucketname</em>.obs.<em id="obs_04_0094__i034434682311">region</em>.example.com
Authorization: <em id="obs_04_0094__i6448144623413">authorization</em>
Date: <em id="obs_04_0094__i1161564918338">date</em></pre>
</div>
<div class="section" id="obs_04_0094__section7884173212178"><h4 class="sectiontitle">Request Parameters</h4><p id="obs_04_0094__p16309123521716">The request needs to specify parameters in the message, indicating that this is a renaming operation, specifying the new name. <a href="#obs_04_0094__table925513139324">Table 1</a> describes the parameters.</p>
<div class="tablenoborder"><a name="obs_04_0094__table925513139324"></a><a name="table925513139324"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0094__table925513139324" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameters</caption><thead align="left"><tr id="obs_04_0094__row19257131316329"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.4.1.1"><p id="obs_04_0094__p1225711133328">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="65.06%" id="mcps1.3.3.3.2.4.1.2"><p id="obs_04_0094__p42576139327">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.940000000000001%" id="mcps1.3.3.3.2.4.1.3"><p id="obs_04_0094__p02571613203212">Mandatory</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0094__row10257191363215"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.4.1.1 "><p id="obs_04_0094__p112574136328">name</p>
</td>
<td class="cellrowborder" valign="top" width="65.06%" headers="mcps1.3.3.3.2.4.1.2 "><p id="obs_04_0094__p8257141319329">New name for the object. Use the absolute path.</p>
<p id="obs_04_0094__p985361893716">Type: string</p>
</td>
<td class="cellrowborder" valign="top" width="14.940000000000001%" headers="mcps1.3.3.3.2.4.1.3 "><p id="obs_04_0094__p112571113123211">Yes</p>
</td>
</tr>
<tr id="obs_04_0094__row15231171411410"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.4.1.1 "><p id="obs_04_0094__p316371710417">rename</p>
</td>
<td class="cellrowborder" valign="top" width="65.06%" headers="mcps1.3.3.3.2.4.1.2 "><p id="obs_04_0094__p1116371712415">Indicates that this is a renaming operation.</p>
<p id="obs_04_0094__p316319170416">Type: string</p>
</td>
<td class="cellrowborder" valign="top" width="14.940000000000001%" headers="mcps1.3.3.3.2.4.1.3 "><p id="obs_04_0094__p1216317174413">Yes</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0094__section31243759"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0094__p55973588">This request uses common request headers. For details, see <a href="obs_04_0007.html#obs_04_0007__table25197309">Table 3</a>.</p>
</div>
<div class="section" id="obs_04_0094__section12758381"><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="obs_04_0094__p2556808">This request involves no elements.</p>
</div>
<div class="section" id="obs_04_0094__section13959410101416"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0094__screen149770441504"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>204<span class="w"> </span>status_code
Server:<span class="w"> </span>OBS
x-obs-request-id:<span class="w"> </span>request-id
x-obs-id-2:<span class="w"> </span>id
Date:<span class="w"> </span>Date
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="obs_04_0094__section69450302141"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0094__p1512332591013">The response to the request uses common headers. For details, see <a href="obs_04_0013.html#obs_04_0013__d0e686">Table 1</a>.</p>
</div>
<div class="section" id="obs_04_0094__section16332845"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0094__p24646447">This response contains no elements.</p>
</div>
<div class="section" id="obs_04_0094__section12777878"><h4 class="sectiontitle">Error Responses</h4><p class="msonormal" id="obs_04_0094__p50205220">No special error responses are returned. For details about error responses, see <a href="obs_04_0115.html#obs_04_0115__d0e843">Table 2</a>.</p>
</div>
<div class="section" id="obs_04_0094__section11686111817239"><h4 class="sectiontitle">Sample Request</h4><pre class="screen" id="obs_04_0094__screen1249964665316">POST /ObjectName?name=file2&amp;rename HTTP/1.1
Host: examplebucket.obs.<em id="obs_04_0094__i12367117502">region</em>.example.com
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:75/Y4Ng1izvzc1nTGxpMXTE6ynw=
Date: WED, 01 Jul 2015 04:19:20 GMT</pre>
</div>
<div class="section" id="obs_04_0094__section6687115054912"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0094__screen314017410502"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>204<span class="w"> </span>No<span class="w"> </span>Content
Server:<span class="w"> </span>OBS
x-obs-request-id:<span class="w"> </span>8DF400000163D3F51DEA05AC9CA066F1
x-obs-id-2:<span class="w"> </span>32AAAUgAIAABAAAQAAEAABAAAQAAEAABCSgkM4Dij80gAeFY8pAZIwx72QhDeBZ5
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>04:19:21<span class="w"> </span>GMT
</pre></div></td></tr></table></div>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_04_0079.html">Operations on Objects</a></div>
</div>
</div>