forked from docs/doc-exports
Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Jawei, Li <lijiawei5@huawei.com> Co-committed-by: Jawei, Li <lijiawei5@huawei.com>
118 lines
8.9 KiB
HTML
118 lines
8.9 KiB
HTML
<a name="obs_04_0085"></a><a name="obs_04_0085"></a>
|
|
|
|
<h1 class="topictitle1">Deleting an Object</h1>
|
|
<div id="body54050549"><div class="section" id="obs_04_0085__section5584184924715"><h4 class="sectiontitle">Functions</h4><p class="msonormal" id="obs_04_0085__p32607795">You can perform this operation to delete an object. If you try to delete an object that does not exist, OBS will return a success message.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0085__section25034704"><h4 class="sectiontitle">Versioning</h4><p class="msonormal" id="obs_04_0085__p16018311">When versioning is enabled for a bucket, a deletion marker with a unique version number is generated when an object is deleted without specifying the version. However, the object is not actually deleted. If versioning is suspended for a bucket and no version is specified when you delete an object, the object whose version number is <strong id="obs_04_0085__b789805613311">null</strong> is deleted, and a deletion marker with version number <strong id="obs_04_0085__b10366999342">null</strong> is generated.</p>
|
|
<p class="msonormal" id="obs_04_0085__p9947077">To delete an object of a specified version, the <strong id="obs_04_0085__b1866401892947">versionId</strong> parameter can be used to specify the desired version.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0085__section23985747"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0085__screen1215151"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
|
|
2
|
|
3
|
|
4</pre></div></td><td class="code"><div class="highlight"><pre><span></span>DELETE /ObjectName HTTP/1.1
|
|
Host: bucketname.obs.region.example.com
|
|
Date: date
|
|
Authorization: authorization
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0085__section14545133"><h4 class="sectiontitle">Request Parameters</h4><p class="msonormal" id="obs_04_0085__p13430076"><a href="#obs_04_0085__d0e15727">Table 1</a> describes the request parameters.</p>
|
|
<div class="notice" id="obs_04_0085__note156845164416"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="obs_04_0085__p73241840182110">For deleting an object, only parameters listed in <a href="#obs_04_0085__d0e15727">Table 1</a> are supported. If the request contains parameters that cannot be identified by OBS, the server returns the 400 error code.</p>
|
|
</div></div>
|
|
|
|
<div class="tablenoborder"><a name="obs_04_0085__d0e15727"></a><a name="d0e15727"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0085__d0e15727" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameters</caption><thead align="left"><tr id="obs_04_0085__row44545009"><th align="left" class="cellrowborder" valign="top" width="22.220000000000002%" id="mcps1.3.4.4.2.4.1.1"><p id="obs_04_0085__p51375997">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="62.629999999999995%" id="mcps1.3.4.4.2.4.1.2"><p id="obs_04_0085__p6356363">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.15%" id="mcps1.3.4.4.2.4.1.3"><p id="obs_04_0085__p3277069">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0085__row40173335"><td class="cellrowborder" valign="top" width="22.220000000000002%" headers="mcps1.3.4.4.2.4.1.1 "><p id="obs_04_0085__p32814727">versionId</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="62.629999999999995%" headers="mcps1.3.4.4.2.4.1.2 "><p id="obs_04_0085__p40747248">Object version ID</p>
|
|
<p id="obs_04_0085__p31180913">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.15%" headers="mcps1.3.4.4.2.4.1.3 "><p id="obs_04_0085__p42625985">No</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0085__section63797335"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0085__p30152733">This request uses common 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_0085__section37305106"><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="obs_04_0085__p36744422">This request involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0085__section201640"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0085__screen25118085"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
|
|
2</pre></div></td><td class="code"><div class="highlight"><pre><span></span>HTTP/1.1 status_code
|
|
Date: date
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0085__section1814760"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0085__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>
|
|
<p class="msonormal" id="obs_04_0085__p24800784">In addition to the common response headers, the following message headers may also be used. For details, see <a href="#obs_04_0085__table862048515455">Table 2</a>.</p>
|
|
|
|
<div class="tablenoborder"><a name="obs_04_0085__table862048515455"></a><a name="table862048515455"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0085__table862048515455" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Additional response header parameters</caption><thead align="left"><tr id="obs_04_0085__row25289386"><th align="left" class="cellrowborder" valign="top" width="40.400000000000006%" id="mcps1.3.8.4.2.3.1.1"><p id="obs_04_0085__p35174418">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="59.599999999999994%" id="mcps1.3.8.4.2.3.1.2"><p id="obs_04_0085__p30555594">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0085__row59084026"><td class="cellrowborder" valign="top" width="40.400000000000006%" headers="mcps1.3.8.4.2.3.1.1 "><p id="obs_04_0085__p21076811">x-obs-delete-marker</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.599999999999994%" headers="mcps1.3.8.4.2.3.1.2 "><p id="obs_04_0085__p29500132">Indicates whether an object is deleted. If the object is not marked as deleted, the response does not contain this header.</p>
|
|
<p id="obs_04_0085__p64174604">Type: boolean</p>
|
|
<p id="obs_04_0085__p40700526">Valid values: <strong id="obs_04_0085__b59967403164459">true</strong> or <strong id="obs_04_0085__b263109916453">false</strong></p>
|
|
<p id="obs_04_0085__p30760421">The default value is <strong id="obs_04_0085__b84235270618335">false</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0085__row8408337"><td class="cellrowborder" valign="top" width="40.400000000000006%" headers="mcps1.3.8.4.2.3.1.1 "><p id="obs_04_0085__p9986676">x-obs-version-id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.599999999999994%" headers="mcps1.3.8.4.2.3.1.2 "><p id="obs_04_0085__p3614399">Object version ID. If the object has no version number specified, the response does not contain this header.</p>
|
|
<p id="obs_04_0085__p32529595">Valid value: character string</p>
|
|
<p id="obs_04_0085__p24330907">There is no default value.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0085__section16332845"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0085__p24646447">This response involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0085__section12777878"><h4 class="sectiontitle">Error Responses</h4><p class="msonormal" id="obs_04_0085__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_0085__section11686111817239"><h4 class="sectiontitle">Sample Request</h4><div class="codecoloring" codetype="Xml" id="obs_04_0085__screen1832282111239"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6</pre></div></td><td class="code"><div class="highlight"><pre><span></span>DELETE /object2 HTTP/1.1
|
|
User-Agent: curl/7.29.0
|
|
Host: examplebucket.obs.region.example.com
|
|
Accept: */*
|
|
Date: WED, 01 Jul 2015 04:19:21 GMT
|
|
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:MfK9JCnSFHCrJmjv7iRkRrrce2s=
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0085__section6687115054912"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0085__screen314017410502"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
|
|
2
|
|
3
|
|
4
|
|
5</pre></div></td><td class="code"><div class="highlight"><pre><span></span>HTTP/1.1 204 No Content
|
|
Server: OBS
|
|
x-obs-request-id: 8DF400000163D3F51DEA05AC9CA066F1
|
|
x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCSgkM4Dij80gAeFY8pAZIwx72QhDeBZ5
|
|
Date: WED, 01 Jul 2015 04:19:21 GMT
|
|
</pre></div>
|
|
</td></tr></table></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>
|
|
|