doc-exports/docs/obs/api-ref/obs_04_0032.html
zhangyue 8ba86cabc9 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-05-28 10:01:19 +00:00

443 lines
35 KiB
HTML

<a name="obs_04_0032"></a><a name="obs_04_0032"></a>
<h1 class="topictitle1">Configuring Logging for a Bucket</h1>
<div id="body64023878"><div class="section" id="obs_04_0032__section5584184924715"><h4 class="sectiontitle">Functions</h4><p class="msonormal" id="obs_04_0032__p1070114345575">When a bucket is created, the logging function is not enabled by default. To generate logs recording operations on buckets, you need to enable the logging function for the bucket. After the logging function is enabled, a log is generated for each operation on a bucket and multiple logs are packed into a log file. When enabling the logging function, you need to specify a location where log files are stored. They can be stored in the bucket for which the logging is enabled, or in other buckets that you have the required permissions. However, the bucket where log files are stored and the bucket for which the logging is enabled must be in the same region.</p>
<p class="msonormal" id="obs_04_0032__p122341134410">Log files are generated by OBS and uploaded to the bucket where logs are stored. Therefore, OBS needs to be authorized to upload generated log files. Before configuring the logging function, you need to create an agency for OBS in IAM, the agency name is configured as a parameter of the bucket, and the logging function must be configured under the <strong id="obs_04_0032__b1169231102719">LoggingEnabled</strong> tag in the XML file. You only need to authorize the agency with the upload permissions for the target bucket.</p>
</div>
<div class="section" id="obs_04_0032__section17415154115136"><h4 class="sectiontitle">Example of agency permissions</h4><pre class="screen" id="obs_04_0032__screen94051115151515">{
"Version": "1.1",
"Statement": [
{
"Action": [
"obs:object:PutObject"
],
"Resource": [
"OBS:*:*:object:mybucketlogs/*"
],
"Effect": "Allow"
}
]
}</pre>
<p class="msonormal" id="obs_04_0032__p20584601">To disable the bucket logging function, upload a logging file with an empty <strong id="obs_04_0032__b16608451173915">BucketLoggingStatus</strong> tag.</p>
<p id="obs_04_0032__p152627273382">By default, a bucket whose storage class is Warm or Cold cannot be used for storing log files. Stored log files occupy storage space in a bucket. Therefore, users are charged for the logging service based on the pricing for data storage.</p>
<div class="caution" id="obs_04_0032__note854184510582"><span class="cautiontitle"><img src="public_sys-resources/caution_3.0-en-us.png"> </span><div class="cautionbody"><p id="obs_04_0032__p1154112451584">If the target bucket has KMS encryption enabled, grant the agency access to KMS.</p>
</div></div>
</div>
<div class="section" id="obs_04_0032__section56739962"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0032__screen52421322"><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>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span>
<span class="normal">18</span>
<span class="normal">19</span>
<span class="normal">20</span></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/?logging<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>signatureValue
<span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<span class="nt">&lt;BucketLoggingStatus&gt;</span>
<span class="w"> </span><span class="nt">&lt;Agency&gt;</span>agency-name<span class="nt">&lt;/Agency&gt;</span>
<span class="w"> </span><span class="nt">&lt;LoggingEnabled&gt;</span>
<span class="w"> </span><span class="nt">&lt;TargetBucket&gt;</span>mybucketlogs<span class="nt">&lt;/TargetBucket&gt;</span>
<span class="w"> </span><span class="nt">&lt;TargetPrefix&gt;</span>mybucket-access_log-/<span class="nt">&lt;/TargetPrefix&gt;</span>
<span class="w"> </span><span class="nt">&lt;TargetGrants&gt;</span>
<span class="w"> </span><span class="nt">&lt;Grant&gt;</span>
<span class="w"> </span><span class="nt">&lt;Grantee&gt;</span>
<span class="w"> </span><span class="nt">&lt;ID&gt;</span>domainID<span class="nt">&lt;/ID&gt;</span>
<span class="w"> </span><span class="nt">&lt;/Grantee&gt;</span>
<span class="w"> </span><span class="nt">&lt;Permission&gt;</span>READ<span class="nt">&lt;/Permission&gt;</span>
<span class="w"> </span><span class="nt">&lt;/Grant&gt;</span>
<span class="w"> </span><span class="nt">&lt;/TargetGrants&gt;</span>
<span class="w"> </span><span class="nt">&lt;/LoggingEnabled&gt;</span>
<span class="nt">&lt;/BucketLoggingStatus&gt;</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="obs_04_0032__section40897617"><h4 class="sectiontitle">Request Parameters</h4><p class="msonormal" id="obs_04_0032__p30200806">This request contains no message parameters.</p>
</div>
<div class="section" id="obs_04_0032__section32534241"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0032__p30346251">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_0032__section24372713"><h4 class="sectiontitle">Request Elements</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0032__table43601282" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request elements</caption><thead align="left"><tr id="obs_04_0032__row36522595"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.6.2.2.4.1.1"><p id="obs_04_0032__p5540243">Element</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.6.2.2.4.1.2"><p id="obs_04_0032__p46106556">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.6.2.2.4.1.3"><p id="obs_04_0032__p43643525">Mandatory</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0032__row45464598"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.1 "><p id="obs_04_0032__p58753816">BucketLoggingStatus</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.2 "><p id="obs_04_0032__p61438642">Container for logging status information</p>
<p id="obs_04_0032__p16076872">Type: container</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.3 "><p id="obs_04_0032__p27158266">Yes</p>
</td>
</tr>
<tr id="obs_04_0032__row1848391612557"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.1 "><p id="obs_04_0032__p1748371625515">Agency</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.2 "><p id="obs_04_0032__p174844168555">Name of the IAM agency created by the owner of the target bucket on IAM.</p>
<p id="obs_04_0032__p1910012645913">Type: string</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.3 "><p id="obs_04_0032__p24842161554">You must set this parameter when enabling the logging function. Do not set this parameter when disabling the logging function.</p>
</td>
</tr>
<tr id="obs_04_0032__row43097809"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.1 "><p id="obs_04_0032__p1261604">LoggingEnabled</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.2 "><p id="obs_04_0032__p35081137">Container for logging information. Present this element when enabling the logging function. Otherwise, absent it. You can add specific logging information in this element.</p>
<p id="obs_04_0032__p47294780">Type: container</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.3 "><p id="obs_04_0032__p5671952">You must set this parameter when enabling the logging function. Do not set this parameter when disabling the logging function.</p>
</td>
</tr>
<tr id="obs_04_0032__row51047571"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.1 "><p id="obs_04_0032__p41212601">Grant</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.2 "><p id="obs_04_0032__p49886391">Container for the grantee and the grantee's logging permissions. It describes who has the permission to access the generated log files.</p>
<p id="obs_04_0032__p46324343">Type: container</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.3 "><p id="obs_04_0032__p61284334">No</p>
</td>
</tr>
<tr id="obs_04_0032__row14688094"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.1 "><p id="obs_04_0032__p48884950">Grantee</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.2 "><p id="obs_04_0032__p257990">Container for the user that is granted with the logging permission.</p>
<p id="obs_04_0032__p2321915">Type: container</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.3 "><p id="obs_04_0032__p53857427">No</p>
</td>
</tr>
<tr id="obs_04_0032__row14954800"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.1 "><p id="obs_04_0032__p3379322">ID</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.2 "><p id="obs_04_0032__p5289693">Account ID of the authorized user, which is globally unique.</p>
<p id="obs_04_0032__p47607239">Type: string</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.3 "><p id="obs_04_0032__p30981121">No</p>
</td>
</tr>
<tr id="obs_04_0032__row48978414"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.1 "><p id="obs_04_0032__p7828572">Permission</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.2 "><p id="obs_04_0032__p30134562">Permissions of the grantee to the generated logs.</p>
<p id="obs_04_0032__p2775606">Type: string</p>
<p id="obs_04_0032__p24980457">Value options: <strong id="obs_04_0032__b448684351012">FULL_CONTROL</strong>, <strong id="obs_04_0032__b1370416472108">READ</strong>, <strong id="obs_04_0032__b14818194961010">WRITE</strong></p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.3 "><p id="obs_04_0032__p10151128">No</p>
</td>
</tr>
<tr id="obs_04_0032__row24251295"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.1 "><p id="obs_04_0032__p18197854">TargetBucket</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.2 "><p id="obs_04_0032__p64740058">When enabling the logging function, the owner of the bucket being logged can specify a target bucket to store the generated log files. Ensure that the bucket owner who configures the logging function has the <strong id="obs_04_0032__b0692112721213">FULL_CONTROL</strong> permission for the bucket that stores log files. Log files generated for multiple buckets can be stored in the same target bucket. If you do so, you need to specify different TargetPrefixes to classify logs for different buckets.</p>
<p id="obs_04_0032__p45789610">Type: string</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.3 "><p id="obs_04_0032__p17970891">You must set this parameter when enabling the logging function. Do not set this parameter when disabling the logging function.</p>
</td>
</tr>
<tr id="obs_04_0032__row27520294"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.1 "><p id="obs_04_0032__p14551367">TargetPrefix</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.2 "><p id="obs_04_0032__p37810117">You can specify a prefix using this element so that log files are named with this prefix.</p>
<p id="obs_04_0032__p4746738">Type: string</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.3 "><p id="obs_04_0032__p48941510">You must set this parameter when enabling the logging function. Do not set this parameter when disabling the logging function.</p>
</td>
</tr>
<tr id="obs_04_0032__row37820406"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.1 "><p id="obs_04_0032__p43554041">TargetGrants</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.2 "><p id="obs_04_0032__p38216441">Container for granting information.</p>
<p id="obs_04_0032__p8403651">Type: container</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.2.2.4.1.3 "><p id="obs_04_0032__p9607112">No</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0032__section484265520413"><h4 class="sectiontitle">Naming rules for access logs</h4><div class="codecoloring" codetype="Xml" id="obs_04_0032__screen1638283116472"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="nt">&lt;TargetPrefix&gt;</span>YYYY-mm-DD-HH-MM-SS-<span class="nt">&lt;UniqueString&gt;</span>
</pre></div></td></tr></table></div>
</div>
<ul id="obs_04_0032__ul073034664916"><li id="obs_04_0032__li157301746184912">&lt;<em id="obs_04_0032__i05437014536">TargetPrefix</em>&gt; is the log name prefix specified by the user.</li><li id="obs_04_0032__li126116813504">YYYY-mm-DD-HH-MM-SS indicates the date and time when the log is generated.</li><li id="obs_04_0032__li351373315513"><em id="obs_04_0032__i20118747155314">&lt;UniqueString&gt;</em> indicates a character string generated by OBS.</li></ul>
<p id="obs_04_0032__p10161523105316">The following is an example of a log file name:</p>
<div class="codecoloring" codetype="Xml" id="obs_04_0032__screen541212713562"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span>bucket-log2015-06-29-12-22-07-N7MXLAF1BDG7MPDV
</pre></div></td></tr></table></div>
</div>
<ul id="obs_04_0032__ul17429184595719"><li id="obs_04_0032__li1542954511576"><strong id="obs_04_0032__b1451859115410">bucket-log</strong> is the target prefix specified by the user.</li><li id="obs_04_0032__li2038125205719"><strong id="obs_04_0032__b167311815195519">2015-06-29-12-22-07</strong> indicates the time when the log is generated.</li><li id="obs_04_0032__li5305115810588"><strong id="obs_04_0032__b4500184118553">N7MXLAF1BDG7MPDV</strong> is a string automatically generated by OBS</li></ul>
</div>
<div class="section" id="obs_04_0032__section218213119011"><h4 class="sectiontitle">Format of bucket access logs</h4><p id="obs_04_0032__p14758098914">The following shows an access log delivered to the target bucket:</p>
<div class="codecoloring" codetype="Xml" id="obs_04_0032__screen87583912919"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span>787f2f92b20943998a4fe2ab75eb09b8<span class="w"> </span>bucket<span class="w"> </span>[13/Aug/2015:01:43:42<span class="w"> </span>+0000]<span class="w"> </span>xx.xx.xx.xx<span class="w"> </span>787f2f92b20943998a4fe2ab75eb09b8<span class="w"> </span>281599BACAD9376ECE141B842B94535B<span class="w"> </span>REST.GET.BUCKET.LOCATION<span class="w"> </span>-<span class="w"> </span>&quot;GET<span class="w"> </span>/bucket?location<span class="w"> </span>HTTP/1.1&quot;<span class="w"> </span>200<span class="w"> </span>-<span class="w"> </span>211<span class="w"> </span>-<span class="w"> </span>6<span class="w"> </span>6<span class="w"> </span>&quot;-&quot;<span class="w"> </span>&quot;HttpClient&quot;<span class="w"> </span>-<span class="w"> </span>-<span class="w"> </span>
</pre></div></td></tr></table></div>
</div>
<p id="obs_04_0032__p1154028197">Each access log contains the following information:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0032__table131214386116" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Format of bucket access logs</caption><thead align="left"><tr id="obs_04_0032__row91211438610"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.8.5.2.4.1.1"><p id="obs_04_0032__p171215388116"><strong id="obs_04_0032__b1661416409583">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="34.36%" id="mcps1.3.8.5.2.4.1.2"><p id="obs_04_0032__p41212381016"><strong id="obs_04_0032__b815821935817">Example</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="35.64%" id="mcps1.3.8.5.2.4.1.3"><p id="obs_04_0032__p812114386117"><strong id="obs_04_0032__b3426542185819">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0032__row1812118381315"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p317119161311">BucketOwner</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p11713161731">787f2f92b20943998a4fe2ab75eb09b8</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p1317111168312">ID of the bucket owner</p>
</td>
</tr>
<tr id="obs_04_0032__row512113386112"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p1717113165312">Bucket</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p3171216839">bucket</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p21714168313">Bucket name</p>
</td>
</tr>
<tr id="obs_04_0032__row161211438717"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p141718161331">Time</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p1217121611311">[13/Aug/2015:14:43:42 +0000]</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p7171316031">Request timestamp in the <em id="obs_04_0032__i952201115343">[dd/MMM/yyyy:HH:mm:ss Z]</em> format</p>
</td>
</tr>
<tr id="obs_04_0032__row71212387114"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p517112168319">Remote IP</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p11171121618320">xx.xx.xx.xx</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p317121610316">Request IP address</p>
</td>
</tr>
<tr id="obs_04_0032__row412120385118"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p1617116161139">Requester</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p4171141618312">787f2f92b20943998a4fe2ab75eb09b8</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p121711816833">ID of the requester</p>
<ul id="obs_04_0032__ul566619211213"><li id="obs_04_0032__li119910462119">When an account initiates a request, this parameter value is the account ID. When an IAM user initiates a request, this parameter value is the ID of the account where the IAM user belongs.</li><li id="obs_04_0032__li866616215217">When an anonymous user initiates a request, this parameter value is <strong id="obs_04_0032__b164243033918">Anonymous</strong>.</li></ul>
</td>
</tr>
<tr id="obs_04_0032__row1012119381212"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p17171181616312">RequestID</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p91713161734">281599BACAD9376ECE141B842B94535B</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p8171121615316">Request ID</p>
</td>
</tr>
<tr id="obs_04_0032__row0121538319"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p15171316734">Operation</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p217121618311">REST.GET.BUCKET.LOCATION</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p917112161834">Operation</p>
</td>
</tr>
<tr id="obs_04_0032__row0997173031516"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p159971730131518">Key</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p4997430191515">-</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p1428011903918">Object name</p>
</td>
</tr>
<tr id="obs_04_0032__row218717133312"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p181712167318">Request-URI</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p151711616837">GET /bucket?location HTTP/1.1</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p1517181618315">Request URI</p>
</td>
</tr>
<tr id="obs_04_0032__row965413106316"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p131710168310">HTTPStatus</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p9171316238">200</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p18171171616313">Response code</p>
</td>
</tr>
<tr id="obs_04_0032__row15399651112010"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p103991051162012">ErrorCode</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p4399185111206">-</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p193991851112014">Error code</p>
</td>
</tr>
<tr id="obs_04_0032__row18264188238"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p117117161836">BytesSent</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p61717167319">211</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p161711016435">Size of the HTTP response, expressed in bytes</p>
</td>
</tr>
<tr id="obs_04_0032__row4789642132118"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p8789114282111">ObjectSize</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p15789144252119">-</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p878954214212">Object size</p>
</td>
</tr>
<tr id="obs_04_0032__row7983195831"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p14171516134">TotalTime</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p1417115160310">6</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p2017114161831">Processing time on the server</p>
<p id="obs_04_0032__p1311121133612">Unit: ms</p>
</td>
</tr>
<tr id="obs_04_0032__row16811143633"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p617110167315">Turn-AroundTime</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p4171616233">6</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p161711716536">Total request processing time</p>
<p id="obs_04_0032__p17298151753620">Unit: ms</p>
</td>
</tr>
<tr id="obs_04_0032__row9951955723"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p0951655520">Referer</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p199511855725">-</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p1195113551720">Referer header of the request</p>
</td>
</tr>
<tr id="obs_04_0032__row144987116315"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p154981012317">User-Agent</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p15498310315">HttpClient</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p549815114320">User-Agent header of the request</p>
</td>
</tr>
<tr id="obs_04_0032__row1320275918214"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p72021159823">VersionID</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p1820219591624">-</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p2020218592212">Version ID contained in a request</p>
</td>
</tr>
<tr id="obs_04_0032__row5594115117310"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p1559445111318">STSLogUrn</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p125943511133">-</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p65941151832">Federated authentication and agency information</p>
</td>
</tr>
<tr id="obs_04_0032__row19277113515471"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p1544434114514"><span style="color:#3D3F43;">StorageClass</span></p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p1961144594519"><span style="color:#3D3F43;">STANDARD_IA</span></p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p47711154124519">Current object storage class</p>
</td>
</tr>
<tr id="obs_04_0032__row4963193824718"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p14330165174612"><span style="color:#3D3F43;">TargetStorageClass</span></p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p1165841084617"><span style="color:#3D3F43;">GLACIER</span></p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><p id="obs_04_0032__p18755131584618">Storage class that the object will be transitioned to</p>
</td>
</tr>
<tr id="obs_04_0032__row18240114118474"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.8.5.2.4.1.1 "><p id="obs_04_0032__p1075817113576">DentryName</p>
</td>
<td class="cellrowborder" valign="top" width="34.36%" headers="mcps1.3.8.5.2.4.1.2 "><p id="obs_04_0032__p19758171110575">12456%2Ffile.txt</p>
</td>
<td class="cellrowborder" valign="top" width="35.64%" headers="mcps1.3.8.5.2.4.1.3 "><ul id="obs_04_0032__ul2231244586"><li id="obs_04_0032__li43112865816">For a parallel file system, this field represents an internal identifier of a file or directory. Its value consists of a parent directory's inode number and a file or directory name and is displayed in the URL-encoded format.</li><li id="obs_04_0032__li132325465812">For a bucket, the value of this field is <strong id="obs_04_0032__b493313198332">-</strong>.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0032__section18027827"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0032__screen39978622"><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="obs_04_0032__section28032721"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0032__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_0032__section50967898"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0032__p52134235">This response contains no elements.</p>
</div>
<div class="section" id="obs_04_0032__section56057905"><h4 class="sectiontitle">Error Responses</h4><p class="msonormal" id="obs_04_0032__p62123516">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_0032__section14482163815396"><h4 class="sectiontitle">Sample Request</h4><div class="codecoloring" codetype="Xml" id="obs_04_0032__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>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span>
<span class="normal">18</span>
<span class="normal">19</span>
<span class="normal">20</span>
<span class="normal">21</span>
<span class="normal">22</span>
<span class="normal">23</span>
<span class="normal">24</span></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/?logging<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>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>02:40:06<span class="w"> </span>GMT
Authorization:<span class="w"> </span>OBS<span class="w"> </span>H4IPJX0TQTHTHEBQQCEC:mCOjER/L4ZZUY9qr6AOnkEiwvVk=
Content-Length:<span class="w"> </span>528
<span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<span class="nt">&lt;BucketLoggingStatus&gt;</span>
<span class="w"> </span><span class="nt">&lt;Agency&gt;</span>agencyGrantPutLogging<span class="nt">&lt;/Agency&gt;</span>
<span class="w"> </span><span class="nt">&lt;LoggingEnabled&gt;</span>
<span class="w"> </span><span class="nt">&lt;TargetBucket&gt;</span>log-bucket<span class="nt">&lt;/TargetBucket&gt;</span>
<span class="w"> </span><span class="nt">&lt;TargetPrefix&gt;</span>mybucket-access_log-/<span class="nt">&lt;/TargetPrefix&gt;</span>
<span class="w"> </span><span class="nt">&lt;TargetGrants&gt;</span>
<span class="w"> </span><span class="nt">&lt;Grant&gt;</span>
<span class="w"> </span><span class="nt">&lt;Grantee&gt;</span>
<span class="w"> </span><span class="nt">&lt;ID&gt;</span>783fc6652cf246c096ea836694f71855<span class="nt">&lt;/ID&gt;</span>
<span class="w"> </span><span class="nt">&lt;/Grantee&gt;</span>
<span class="w"> </span><span class="nt">&lt;Permission&gt;</span>READ<span class="nt">&lt;/Permission&gt;</span>
<span class="w"> </span><span class="nt">&lt;/Grant&gt;</span>
<span class="w"> </span><span class="nt">&lt;/TargetGrants&gt;</span>
<span class="w"> </span><span class="nt">&lt;/LoggingEnabled&gt;</span>
<span class="nt">&lt;/BucketLoggingStatus&gt;</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="obs_04_0032__section76081155815"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0032__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></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-obs-request-id:<span class="w"> </span>BF26000001643663CE53B6AF31C619FD
x-obs-id-2:<span class="w"> </span>32AAAQAAEAABSAAkpAIAABAAAQAAEAABCT9CjuOx8cETSRbqkm35s1dL/tLhRNdZ
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>02:40:06<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="obs_04_0026.html">Advanced Bucket Settings</a></div>
</div>
</div>