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>
128 lines
10 KiB
HTML
128 lines
10 KiB
HTML
<a name="EN-US_TOPIC_0250433782"></a><a name="EN-US_TOPIC_0250433782"></a>
|
|
|
|
<h1 class="topictitle1">PUT Bucket request payment</h1>
|
|
<div id="body1590721492986"><p class="msonormal" id="EN-US_TOPIC_0250433782__p42175431">The requester-pays configuration allows the requester to pay for data transfer and API calls associated with accessing the requested OBS resources, while the bucket owner only pays for data storage.</p>
|
|
<div class="note" id="EN-US_TOPIC_0250433782__note20861132681814"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0250433782__p1486114267182">To access a requester-pays bucket, users (except the bucket owner and IAM users under the same account as the bucket owner) must add the x-amz-request-payer: requester header in the request, indicating that the requester agrees to pay for the request and traffic. If this header is not included in the request, the authentication fails and error "403 Forbidden" is returned. If the response returned by the server includes the x-amz-request-charged: requester header, the requester is billed for the request. This rule is applicable to all API requests against requester-pays buckets.</p>
|
|
</div></div>
|
|
|
|
<div class="section" id="EN-US_TOPIC_0250433782__section57518732"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="EN-US_TOPIC_0250433782__screen6103826"><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>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span>
|
|
<span class="normal">8</span>
|
|
<span class="normal">9</span></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/?requestPayment<span class="w"> </span>HTTP/1.1<span class="w"> </span>
|
|
Host:<span class="w"> </span>bucketname.obs.region.example.com
|
|
Date:<span class="w"> </span>date
|
|
Authorization:<span class="w"> </span>authorization
|
|
Content-Length:<span class="w"> </span>length
|
|
|
|
<span class="nt"><RequestPaymentConfiguration></span><span class="w"> </span>
|
|
<span class="w"> </span><span class="nt"><Payer></span>Payer<span class="nt"></Payer></span>
|
|
<span class="nt"></RequestPaymentConfiguration></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0250433782__section47906541"><h4 class="sectiontitle">Request Parameters</h4><p id="EN-US_TOPIC_0250433782__p26589862">This request involves no parameters.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0250433782__section28505693"><h4 class="sectiontitle">Request Headers</h4><p id="EN-US_TOPIC_0250433782__p6295248">This request uses common headers. For details about common request headers, see section <a href="en-us_topic_0125560462.html">Common Request Headers</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0250433782__section55224652"><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="EN-US_TOPIC_0250433782__p66708519">This request contains elements that specify the requester-pays configuration for the bucket. Configuration information is uploaded in the XML format. The following table lists request elements.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0250433782__d0e7246" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Elements for configuring the requester-pays function</caption><thead align="left"><tr id="EN-US_TOPIC_0250433782__row52104816"><th align="left" class="cellrowborder" valign="top" width="26.590000000000003%" id="mcps1.3.7.3.2.4.1.1"><p id="EN-US_TOPIC_0250433782__p59740538">Element</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="58.099999999999994%" id="mcps1.3.7.3.2.4.1.2"><p id="EN-US_TOPIC_0250433782__p64308536">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.310000000000002%" id="mcps1.3.7.3.2.4.1.3"><p id="EN-US_TOPIC_0250433782__p38936003">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0250433782__row64406127"><td class="cellrowborder" valign="top" width="26.590000000000003%" headers="mcps1.3.7.3.2.4.1.1 "><p id="EN-US_TOPIC_0250433782__p49513773">RequestPaymentConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="58.099999999999994%" headers="mcps1.3.7.3.2.4.1.2 "><p id="EN-US_TOPIC_0250433782__p51192643">Root node of the requester-pays configuration.</p>
|
|
<p id="EN-US_TOPIC_0250433782__p58080607">Ancestor: none</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.310000000000002%" headers="mcps1.3.7.3.2.4.1.3 "><p id="EN-US_TOPIC_0250433782__p6908717">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0250433782__row62178457"><td class="cellrowborder" valign="top" width="26.590000000000003%" headers="mcps1.3.7.3.2.4.1.1 "><p id="EN-US_TOPIC_0250433782__p3290281">Payer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="58.099999999999994%" headers="mcps1.3.7.3.2.4.1.2 "><p id="EN-US_TOPIC_0250433782__p65186226">Specifies who pays for accessing resources in the bucket.</p>
|
|
<p id="EN-US_TOPIC_0250433782__p49805123">Type: enumeration</p>
|
|
<p id="EN-US_TOPIC_0250433782__p45592923">Ancestor: <strong id="EN-US_TOPIC_0250433782__b879392483017">RequestPaymentConfiguration</strong></p>
|
|
<p id="EN-US_TOPIC_0250433782__p8695201710314">Valid values:</p>
|
|
<ul id="EN-US_TOPIC_0250433782__ul176341522143118"><li id="EN-US_TOPIC_0250433782__li13634152219310"><strong id="EN-US_TOPIC_0250433782__b0990925913">BucketOwner</strong>: The bucket owner pays all fees associated with the bucket.</li><li id="EN-US_TOPIC_0250433782__li6814824203113"><strong id="EN-US_TOPIC_0250433782__b1978517211694">Requester</strong>: The requester pays for data transfer and API calls associated with accessing resources in the bucket, while the bucket owner pays for data storage in the bucket.</li></ul>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.310000000000002%" headers="mcps1.3.7.3.2.4.1.3 "><p id="EN-US_TOPIC_0250433782__p18353199">Yes</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0250433782__section46270551"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="EN-US_TOPIC_0250433782__screen10214176"><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></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>status_code
|
|
Date:<span class="w"> </span>date
|
|
Content-Length:<span class="w"> </span>length
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0250433782__section13781782"><h4 class="sectiontitle">Response Headers</h4><p id="EN-US_TOPIC_0250433782__p63490983">This response uses common headers. For details about common response headers, see section <a href="en-us_topic_0125560484.html">Common Response Headers</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0250433782__section56927182"><h4 class="sectiontitle">Response Elements</h4><p id="EN-US_TOPIC_0250433782__p19621447">This response involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0250433782__section42582590"><h4 class="sectiontitle">Error Responses</h4><p id="EN-US_TOPIC_0250433782__p45833411">No special error responses are returned. For details about error responses, see <a href="en-us_topic_0125560440.html#EN-US_TOPIC_0125560440__table30733758">Table 1</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0250433782__section32323009"><h4 class="sectiontitle">Sample Request</h4><div class="codecoloring" codetype="Xml" id="EN-US_TOPIC_0250433782__screen8484163863919"><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>
|
|
<span class="normal"> 6</span>
|
|
<span class="normal"> 7</span>
|
|
<span class="normal"> 8</span>
|
|
<span class="normal"> 9</span>
|
|
<span class="normal">10</span></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/?requestPayment<span class="w"> </span>HTTP/1.1
|
|
User-Agent:<span class="w"> </span>curl/7.29.0
|
|
Host:<span class="w"> </span>examplebucket.obs.region.example.com
|
|
Accept:<span class="w"> </span>*/*
|
|
Date:<span class="w"> </span>Tue,<span class="w"> </span>03<span class="w"> </span>Mar<span class="w"> </span>2020<span class="w"> </span>12:07:05<span class="w"> </span>GMT
|
|
Authorization:<span class="w"> </span>authorization
|
|
|
|
<span class="nt"><RequestPaymentConfiguration></span><span class="w"> </span>
|
|
<span class="w"> </span><span class="nt"><Payer></span>Requester<span class="nt"></Payer></span>
|
|
<span class="nt"></RequestPaymentConfiguration></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0250433782__section22471632"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="EN-US_TOPIC_0250433782__screen8485113814"><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>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>200<span class="w"> </span>OK
|
|
Server:<span class="w"> </span>OBS
|
|
x-amz-request-id:<span class="w"> </span>0000016A6C21AD79654C09D9AA45EB5D
|
|
x-amz-id-2:<span class="w"> </span>32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSmfq4hegf1QZv8/ewfveE4B566v5DZ8
|
|
Content-Type:<span class="w"> </span>application/xml
|
|
Date:<span class="w"> </span>Tue,<span class="w"> </span>30<span class="w"> </span>Apr<span class="w"> </span>2019<span class="w"> </span>02:45:07<span class="w"> </span>GMT
|
|
Content-Length:<span class="w"> </span>0
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0125560493.html">Operations on Buckets</a></div>
|
|
</div>
|
|
</div>
|
|
|