doc-exports/docs/obs/s3api/en-us_topic_0000001080550512.html
zhangyue 6fcdbfd13e OBS S3 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-02-26 11:17:13 +00:00

149 lines
12 KiB
HTML

<a name="EN-US_TOPIC_0000001080550512"></a><a name="EN-US_TOPIC_0000001080550512"></a>
<h1 class="topictitle1">GET Bucket Encryption</h1>
<div id="body0000001080550512"><p id="EN-US_TOPIC_0000001080550512__p328123010563">OBS uses the GET method to obtain the encryption configuration of a specified bucket.</p>
<p id="EN-US_TOPIC_0000001080550512__p028114308563">To perform this operation, you must have the <strong id="EN-US_TOPIC_0000001080550512__b385714265271">s3:GetEncryptionConfiguration</strong> permission. By default, only the bucket owner can delete the tags of a bucket. The bucket owner can allow other users to perform this operation by setting a bucket policy or granting them the permission.</p>
<div class="section" id="EN-US_TOPIC_0000001080550512__section57518732"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="EN-US_TOPIC_0000001080550512__screen656246211548"><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>GET<span class="w"> </span>/?encryption<span class="w"> </span>HTTP/1.1
User-Agent:<span class="w"> </span>curl/7.29.0
Host:<span class="w"> </span>bucketname.obs.region.example.com
Accept:<span class="w"> </span>*/*
Date:<span class="w"> </span>date<span class="w"> </span>
Authorization:<span class="w"> </span>authorization<span class="w"> </span>string
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001080550512__section47906541"><h4 class="sectiontitle">Request Parameters</h4><p id="EN-US_TOPIC_0000001080550512__p194119471237">This request contains no parameter.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001080550512__section28505693"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="EN-US_TOPIC_0000001080550512__p30785969">This request uses common headers. For details about common request headers, see the section <a href="en-us_topic_0125560462.html">Common Request Headers</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001080550512__section55224652"><h4 class="sectiontitle">Request Elements</h4><p id="EN-US_TOPIC_0000001080550512__p1239212161841">This request involves no elements.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001080550512__section46270551"><h4 class="sectiontitle">Response Syntax</h4><pre class="screen" id="EN-US_TOPIC_0000001080550512__screen26997610122811">HTTP/1.1 <em id="EN-US_TOPIC_0000001080550512__i138861958164515"><span style="color:#FF0000;">status_code</span></em>
x-amz-request-id: <em id="EN-US_TOPIC_0000001080550512__i17740158134918"><span style="color:#FF0000;">request id </span></em>
x-amz-id-2: <em id="EN-US_TOPIC_0000001080550512__i1491051184910"><span style="color:#FF0000;">id </span></em>
Content-Type: application/xml
Content-Length: <em id="EN-US_TOPIC_0000001080550512__i2075032012494"><span style="color:#FF0000;">length </span></em>
Date: <em style="color:#FF0000;" id="EN-US_TOPIC_0000001080550512__i126071152328">date </em>
&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
&lt;ServerSideEncryptionConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/"&gt;
&lt;Rule&gt;
&lt;ApplyServerSideEncryptionByDefault&gt;
&lt;SSEAlgorithm&gt;aws:kms&lt;/SSEAlgorithm&gt;
&lt;KMSMasterKeyID&gt;<em style="color:#FF0000;" id="EN-US_TOPIC_0000001080550512__i16161121324712">kmskeyid-value</em>&lt;/KMSMasterKeyID&gt;
&lt;/ApplyServerSideEncryptionByDefault&gt;
&lt;/Rule&gt;
&lt;/ServerSideEncryptionConfiguration&gt;</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001080550512__section13781782"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="EN-US_TOPIC_0000001080550512__p4179377">This response uses common headers. For details about common response headers, see the section <a href="en-us_topic_0125560484.html">Common Response Headers</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001080550512__section56927182"><h4 class="sectiontitle">Response Elements</h4><p id="EN-US_TOPIC_0000001080550512__p128781711134314">This response contains the following elements to detail bucket encryption configuration:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001080550512__table1181123018399" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Configuration elements of bucket encryption</caption><thead align="left"><tr id="EN-US_TOPIC_0000001080550512__row2018917307393"><th align="left" class="cellrowborder" valign="top" width="39.35%" id="mcps1.3.9.3.2.3.1.1"><p id="EN-US_TOPIC_0000001080550512__p19190143043913">Header</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60.650000000000006%" id="mcps1.3.9.3.2.3.1.2"><p id="EN-US_TOPIC_0000001080550512__p019273012397">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001080550512__row7197230193913"><td class="cellrowborder" valign="top" width="39.35%" headers="mcps1.3.9.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001080550512__p125361017184212">ServerSideEncryptionConfiguration</p>
</td>
<td class="cellrowborder" valign="top" width="60.650000000000006%" headers="mcps1.3.9.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001080550512__p6536111718422">Root element of the default encryption configuration of a bucket.</p>
<p id="EN-US_TOPIC_0000001080550512__p85368172423">Type: element</p>
<p id="EN-US_TOPIC_0000001080550512__p125365178429">Ancestor: none</p>
<p id="EN-US_TOPIC_0000001080550512__p1555484273118">Children: Rule</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001080550512__row12641636422"><td class="cellrowborder" valign="top" width="39.35%" headers="mcps1.3.9.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001080550512__p3911152616425">Rule</p>
</td>
<td class="cellrowborder" valign="top" width="60.650000000000006%" headers="mcps1.3.9.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001080550512__p591252604217">Sub-element of the default encryption configuration of a bucket.</p>
<p id="EN-US_TOPIC_0000001080550512__p391202634216">Type: element</p>
<p id="EN-US_TOPIC_0000001080550512__p4912142604210">Ancestor: ServerSideEncryptionConfiguration</p>
<p id="EN-US_TOPIC_0000001080550512__p83382043312">Children: ApplyServerSideEncryptionByDefault</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001080550512__row944320444211"><td class="cellrowborder" valign="top" width="39.35%" headers="mcps1.3.9.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001080550512__p163325395428">ApplyServerSideEncryptionByDefault</p>
</td>
<td class="cellrowborder" valign="top" width="60.650000000000006%" headers="mcps1.3.9.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001080550512__p8333639114218">Sub-element of the default encryption configuration of a bucket.</p>
<p id="EN-US_TOPIC_0000001080550512__p1233323919429">Type: element</p>
<p id="EN-US_TOPIC_0000001080550512__p0333163974214">Ancestor: Rule</p>
<p id="EN-US_TOPIC_0000001080550512__p2559123813510">Children: SSEAlgorithm, KMSMasterKeyID</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001080550512__row1314615104218"><td class="cellrowborder" valign="top" width="39.35%" headers="mcps1.3.9.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001080550512__p11495174818425">SSEAlgorithm</p>
</td>
<td class="cellrowborder" valign="top" width="60.650000000000006%" headers="mcps1.3.9.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001080550512__p74952488427">The server-side encryption algorithm used for encryption configuration of a bucket.</p>
<p id="EN-US_TOPIC_0000001080550512__p1543373514489">Type: string</p>
<p id="EN-US_TOPIC_0000001080550512__p1349514814423">Valid values: <strong id="EN-US_TOPIC_0000001080550512__b7731144973819">aws:kms</strong></p>
<p id="EN-US_TOPIC_0000001080550512__p1089135793715">Ancestor: ApplyServerSideEncryptionByDefault</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001080550512__row13866105154213"><td class="cellrowborder" valign="top" width="39.35%" headers="mcps1.3.9.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001080550512__p196161654134219"><span style="color:#444444;">KMSMasterKeyID</span></p>
</td>
<td class="cellrowborder" valign="top" width="60.650000000000006%" headers="mcps1.3.9.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001080550512__p19616854174215">ID of the customer master key (CMK) used for SSE-KMS.</p>
<p id="EN-US_TOPIC_0000001080550512__p7616135414424">Type: string</p>
<p id="EN-US_TOPIC_0000001080550512__p2616105415423">Ancestor: ApplyServerSideEncryptionByDefault</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001080550512__section42582590"><h4 class="sectiontitle">Error Responses</h4><p id="EN-US_TOPIC_0000001080550512__p2866601656">In addition common error codes, this API also returns other error codes. The following table lists common errors and possible causes. For details, see <a href="#EN-US_TOPIC_0000001080550512__table1488314173514">Table 2</a>.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001080550512__table1488314173514"></a><a name="table1488314173514"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001080550512__table1488314173514" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Error codes related to getting bucket encryption configuration</caption><thead align="left"><tr id="EN-US_TOPIC_0000001080550512__row6181181352"><th align="left" class="cellrowborder" valign="top" width="33.67000000000001%" id="mcps1.3.10.3.2.4.1.1"><p id="EN-US_TOPIC_0000001080550512__p11810181514">Error Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="45.63%" id="mcps1.3.10.3.2.4.1.2"><p id="EN-US_TOPIC_0000001080550512__p618131810511">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.700000000000003%" id="mcps1.3.10.3.2.4.1.3"><p id="EN-US_TOPIC_0000001080550512__p18190181851">HTTP Status Code</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001080550512__row1719418653"><td class="cellrowborder" valign="top" width="33.67000000000001%" headers="mcps1.3.10.3.2.4.1.1 "><p id="EN-US_TOPIC_0000001080550512__p35545542212">NoSuchEncryptionConfiguration</p>
</td>
<td class="cellrowborder" valign="top" width="45.63%" headers="mcps1.3.10.3.2.4.1.2 "><p id="EN-US_TOPIC_0000001080550512__p14197185516">The specified bucket does not have any encryption configurations</p>
</td>
<td class="cellrowborder" valign="top" width="20.700000000000003%" headers="mcps1.3.10.3.2.4.1.3 "><p id="EN-US_TOPIC_0000001080550512__p21916186514">404 Not Found</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001080550512__section32323009"><h4 class="sectiontitle">Sample Request</h4><pre class="screen" id="EN-US_TOPIC_0000001080550512__screen64813472204553">GET /?encryption HTTP/1.1
User-Agent: curl/7.29.0
Host: examplebucket.obs.<em id="EN-US_TOPIC_0000001080550512__i12367117502">region</em>.example.com
Accept: */*
Date: Thu, 21 Feb 2019 03:05:34 GMT
Authorization: authorization</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001080550512__section22471632"><h4 class="sectiontitle">Sample Response</h4><pre class="screen" id="EN-US_TOPIC_0000001080550512__screen47322359204949">HTTP/1.1 200 OK
Server: OBS
x-amz-request-id: BF26000001643670AC06E7B9A7767921
x-amz-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSvK6z8HV6nrJh49gsB5vqzpgtohkiFm
Date: Thu, 21 Feb 2019 03:05:34 GMT
Content-Length: 788
&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
&lt;ServerSideEncryptionConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/"&gt;
&lt;Rule&gt;
&lt;ApplyServerSideEncryptionByDefault&gt;
&lt;SSEAlgorithm&gt;aws:kms&lt;/SSEAlgorithm&gt;
&lt;KMSMasterKeyID&gt;4f1cd4de-ab64-4807-920a-47fc42e7f0d0&lt;/KMSMasterKeyID&gt;
&lt;/ApplyServerSideEncryptionByDefault&gt;
&lt;/Rule&gt;
&lt;/ServerSideEncryptionConfiguration&gt;</pre>
</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>