forked from docs/doc-exports
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com> Co-authored-by: zhangyue <zhangyue164@huawei.com> Co-committed-by: zhangyue <zhangyue164@huawei.com>
93 lines
7.1 KiB
HTML
93 lines
7.1 KiB
HTML
<a name="obs_04_0093"></a><a name="obs_04_0093"></a>
|
|
|
|
<h1 class="topictitle1">Truncating an Object</h1>
|
|
<div id="body1541665569463"><div class="section" id="obs_04_0093__section5584184924715"><h4 class="sectiontitle">Functions</h4><p id="obs_04_0093__p2025912321245">This operation can truncate an object to a specified size.</p>
|
|
<div class="note" id="obs_04_0093__note157119479517"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_04_0093__obs_04_0092_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>.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0093__section114577124330"><h4 class="sectiontitle">Request Syntax</h4><pre class="screen" id="obs_04_0093__screen19507212133311">PUT /ObjectName?truncate&length=<em id="obs_04_0093__i162921446175020">Length</em> HTTP/1.1
|
|
Host: <em id="obs_04_0093__i123441746202313">bucketname</em>.obs.<em id="obs_04_0093__i034434682311">region</em>.example.com
|
|
Authorization: <em id="obs_04_0093__i6448144623413">authorization</em>
|
|
Content-Length: <em id="obs_04_0093__i1278910151315">length</em>
|
|
Date: <em id="obs_04_0093__i450718121333">date</em></pre>
|
|
</div>
|
|
<div class="section" id="obs_04_0093__section7884173212178"><h4 class="sectiontitle">Request Parameters</h4><p id="obs_04_0093__p16309123521716">The request needs to specify parameters in the message, indicating that this is to truncate an object to a specified size. <a href="#obs_04_0093__table925513139324">Table 1</a> describes the parameters.</p>
|
|
|
|
<div class="tablenoborder"><a name="obs_04_0093__table925513139324"></a><a name="table925513139324"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0093__table925513139324" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameters</caption><thead align="left"><tr id="obs_04_0093__row19257131316329"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.4.1.1"><p id="obs_04_0093__p1225711133328">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="66.75%" id="mcps1.3.3.3.2.4.1.2"><p id="obs_04_0093__p42576139327">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="13.25%" id="mcps1.3.3.3.2.4.1.3"><p id="obs_04_0093__p02571613203212">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0093__row142578134329"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.4.1.1 "><p id="obs_04_0093__p152571913133211">truncate</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.75%" headers="mcps1.3.3.3.2.4.1.2 "><p id="obs_04_0093__p1257131311321">Indicates that the upload is for truncation.</p>
|
|
<p id="obs_04_0093__p13637133619365">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.25%" headers="mcps1.3.3.3.2.4.1.3 "><p id="obs_04_0093__p725751343214">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0093__row10257191363215"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.4.1.1 "><p id="obs_04_0093__p112574136328">length</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.75%" headers="mcps1.3.3.3.2.4.1.2 "><p id="obs_04_0093__p8257141319329">Size of the object after the truncation</p>
|
|
<p id="obs_04_0093__p985361893716">Type: integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.25%" headers="mcps1.3.3.3.2.4.1.3 "><p id="obs_04_0093__p112571113123211">Yes</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0093__section31243759"><h4 class="sectiontitle">Request headers</h4><p class="msonormal" id="obs_04_0093__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_0093__section12758381"><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="obs_04_0093__p2556808">This request involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0093__section1776885913534"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0093__screen1518420258598"><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_0093__section209761791549"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0093__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_0093__section16332845"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0093__p24646447">This response contains no elements.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0093__section12777878"><h4 class="sectiontitle">Error Responses</h4><p class="msonormal" id="obs_04_0093__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_0093__section11686111817239"><h4 class="sectiontitle">Sample Request</h4><pre class="screen" id="obs_04_0093__screen1249964665316">PUT /ObjectName?truncate&length=1000 HTTP/1.1
|
|
Host: examplebucket.obs.<em id="obs_04_0093__i12367117502">region</em>.example.com
|
|
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:75/Y4Ng1izvzc1nTGxpMXTE6ynw=
|
|
Content-Length: 1
|
|
Date: WED, 01 Jul 2015 04:19:20 GMT</pre>
|
|
</div>
|
|
<div class="section" id="obs_04_0093__section6687115054912"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0093__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>
|
|
|