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>
336 lines
33 KiB
HTML
336 lines
33 KiB
HTML
<a name="EN-US_TOPIC_0125560399"></a><a name="EN-US_TOPIC_0125560399"></a>
|
|
|
|
<h1 class="topictitle1">PUT Object</h1>
|
|
<div id="body20224181"><p id="EN-US_TOPIC_0125560399__p870302912375">After creating a bucket in OBS, you can use this operation to upload an object to the bucket.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p55384650">Uploading an object adds it to a bucket. This operation requires users to have the write permission.</p>
|
|
<div class="note" id="EN-US_TOPIC_0125560399__note28699807"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p class="text" id="EN-US_TOPIC_0125560399__p47799905">The objects uploaded by users are stored in buckets. Only the users with the write permission can upload objects to buckets. The names of objects in the same bucket must be unique.</p>
|
|
</div></div>
|
|
<p id="EN-US_TOPIC_0125560399__p15140134511384">If objects with the same object keys exist in a specified bucket, the new objects uploaded by a user will overwrite the original objects.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p115941657183816">To prevent data from being damaged during the transfer process, users can add <strong id="EN-US_TOPIC_0125560399__b1459475713382">Content-MD5</strong> to request headers. After OBS receives the objects that are uploaded, it executes MD5 verification and returns an error if inconsistency is detected.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p56971675">Users can specify the <strong id="EN-US_TOPIC_0125560399__b86624499919">x-amz-acl</strong> parameter and set a permission control policy when uploading objects.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p9689118165123">This operation supports server-side encryption.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p42983031">After creating a bucket in OBS, you can send a <strong id="EN-US_TOPIC_0125560399__b68895551998">PUT Object</strong> request to upload an object to the bucket.</p>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section51302964"><h4 class="sectiontitle">Versioning</h4><p id="EN-US_TOPIC_0125560399__p4893323">If a bucket has versioning enabled, the system automatically generates a unique version ID for the requested object in this bucket and returns the version ID in response header <strong id="EN-US_TOPIC_0125560399__b4239114151012">x-amz-version-id</strong>. If a bucket has versioning suspended, the version ID of the requested object in this bucket is <strong id="EN-US_TOPIC_0125560399__b60814919">null</strong>. For details about bucket versioning, see section <a href="en-us_topic_0125560444.html">PUT Bucket versioning</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section1475721115541"><h4 class="sectiontitle">WORM</h4><p id="EN-US_TOPIC_0125560399__p759131755418">If a bucket has WORM enabled, you can configure retention policies for objects in the bucket. You can specify the <strong id="EN-US_TOPIC_0125560399__b1821612513390">x-amz-object-lock-mode</strong> and <strong id="EN-US_TOPIC_0125560399__b378111773910">x-amz-object-lock-retain-until-date</strong> headers to configure a retention policy when you upload an object. If you do not specify these two headers but have configured a default bucket-level WORM policy, this default policy automatically applies to the object newly uploaded. You can also configure or update a WORM retention policy for an existing object, see section <a href="en-us_topic_0000001806154009.html">Configuring WORM Retention for an Object</a>.</p>
|
|
<div class="note" id="EN-US_TOPIC_0125560399__note143221114511"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0125560399__p1277512964714">When you enable WORM for a bucket, OBS automatically enables versioning for the bucket. WORM protects objects based on the object version IDs. Only object versions with any WORM retention policy configured will be protected. Assume that object <strong id="EN-US_TOPIC_0125560399__b86122918189">test.txt 001</strong> is protected by WORM. If another file with the same name is uploaded, a new object version <strong id="EN-US_TOPIC_0125560399__b1110331181915">test.txt 002</strong> with no WORM policy configured will be generated. In such case, <strong id="EN-US_TOPIC_0125560399__b5285134217204">test.txt 002</strong> is not protected and can be deleted. When you download an object without specifying a version ID, the current object version (<strong id="EN-US_TOPIC_0125560399__b863463619217">test.txt 002</strong>) will be downloaded.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section2166644"><h4 class="sectiontitle">Request Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560399__screen9772976111133">PUT /ObjectName HTTP/1.1
|
|
User-Agent: agent
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Content-Type: type
|
|
Content-Length: length
|
|
Authorization: authorization
|
|
Date: date
|
|
<Optional Additional Header>
|
|
|
|
<object Content></pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section19499801"><h4 class="sectiontitle">Request Parameters</h4><p id="EN-US_TOPIC_0125560399__p33027006">This request involves no parameters.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section41280485"><h4 class="sectiontitle">Request Headers</h4><p id="EN-US_TOPIC_0125560399__p57941852">You can add optional headers to this request. For details about the optional headers, see <a href="#EN-US_TOPIC_0125560399__table21799862">Table 1</a>.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560399__table21799862"></a><a name="table21799862"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560399__table21799862" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Optional request headers</caption><thead align="left"><tr id="EN-US_TOPIC_0125560399__row52930045"><th align="left" class="cellrowborder" valign="top" width="24.09%" id="mcps1.3.13.3.2.4.1.1"><p id="EN-US_TOPIC_0125560399__p59475228">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="42.58%" id="mcps1.3.13.3.2.4.1.2"><p id="EN-US_TOPIC_0125560399__p52764152">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33%" id="mcps1.3.13.3.2.4.1.3"><p id="EN-US_TOPIC_0125560399__p46037880">Remarks</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560399__row38080772"><td class="cellrowborder" valign="top" width="24.09%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560399__p64643717">Content-MD5</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.58%" headers="mcps1.3.13.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560399__p1649763">The MD5 digest string of the message body is calculated according to the RFC 1864 standard. That is, calculate the 128-bit binary array (the message header data encrypted with MD5) first, and then use Base 64 encoding to convert the binary data to a character string.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p14847872">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560399__p66521989">Example: <strong id="EN-US_TOPIC_0125560399__b20704191319109">n58IG6hfM7vqI4K0vnWpog==</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560399__p41930743">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row41832375"><td class="cellrowborder" valign="top" width="24.09%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560399__p32979223">x-amz-acl</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.58%" headers="mcps1.3.13.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560399__p1338284833911">Indicates the ACL applied to an object.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p41156112408">The value of this header is a predefined character string that is not user-configurable.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p54071387">Possible values are <strong id="EN-US_TOPIC_0125560399__b16880438">private</strong>, <strong id="EN-US_TOPIC_0125560399__b17706220">public-read</strong>, <strong id="EN-US_TOPIC_0125560399__b25138252">public-read-write</strong>, <strong id="EN-US_TOPIC_0125560399__b24917681">authenticated-read</strong>, <strong id="EN-US_TOPIC_0125560399__b22932538">bucket-owner-read</strong>, and <strong id="EN-US_TOPIC_0125560399__b5066258">bucket-owner-full-control</strong>. For further details, see <a href="en-us_topic_0125560406.html#EN-US_TOPIC_0125560406__table40200743">Table 4</a>.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p7713785">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560399__p10060146">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row14907262256"><td class="cellrowborder" valign="top" width="24.09%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560399__p1057752116419">x-amz-storage-class</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.58%" headers="mcps1.3.13.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560399__p7305518157">When creating an object, you can add this header in the request to set the storage class of the object. If you do not add this header, the object will use the default storage class of the bucket.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p183055181656">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560399__p83054181511">Note: The storage class can be <strong id="EN-US_TOPIC_0125560399__b4305121814519">STANDARD</strong> (OBS Standard), <strong id="EN-US_TOPIC_0125560399__b1830516181052">STANDARD_IA</strong> (OBS Warm), or <strong id="EN-US_TOPIC_0125560399__b43051018859">GLACIER</strong> (OBS Cold). Note that the three storage class values are case-sensitive.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p63051018859">Example: x-amz-storage-class: STANDARD</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560399__p1157872174110">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row23432457"><td class="cellrowborder" valign="top" width="24.09%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560399__p18980874">x-amz-meta-*</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.58%" headers="mcps1.3.13.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560399__p61055827">This prefix is used to construct a header in an HTTP request for returning self-defined metadata. If this prefix is specified, user-defined metadata is returned in one or more response headers prefixed with <strong id="EN-US_TOPIC_0125560399__b12631539">x-amz-meta-</strong>.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p162423294106">Note: The format of the user-defined metadata header is x-amz-meta-key:value. The total size of the key and value of all user-defined metadata in the request cannot exceed 2 KB.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p16521724">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560399__p77431826184012">Example:</p>
|
|
<p id="EN-US_TOPIC_0125560399__p14477792">x-amz-meta-test: test metadata</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560399__p18218892">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row29752302"><td class="cellrowborder" valign="top" width="24.09%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560399__p61126266">x-amz-website-redirect-location</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.58%" headers="mcps1.3.13.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560399__p11530945154019">If a bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p1366553914409">OBS stores the value of this header in the object metadata.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p762549">In the following example, the request header sets the redirection to an object (anotherPage.html) in the same bucket:</p>
|
|
<p id="EN-US_TOPIC_0125560399__p6862947">x-amz-website-redirect-location:/anotherPage.html</p>
|
|
<p id="EN-US_TOPIC_0125560399__p61766529">In the following example, the request header sets the object redirection to an external URL:</p>
|
|
<p id="EN-US_TOPIC_0125560399__p299214691204">x-amz-website-redirect-location:http://www.example.com/</p>
|
|
<p id="EN-US_TOPIC_0125560399__p37032986">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560399__p64861423">Default: None</p>
|
|
<p id="EN-US_TOPIC_0125560399__p46881895">Constraint: The value must be prefixed by a slash (/), <strong id="EN-US_TOPIC_0125560399__b19283877">http://</strong>, or <strong id="EN-US_TOPIC_0125560399__b3985524151014">https://</strong>. The length of the value cannot exceed 2 K.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560399__p32194111">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row46731220101837"><td class="cellrowborder" valign="top" width="24.09%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560399__p47424020165233">x-amz-server-side-encryption</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.58%" headers="mcps1.3.13.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560399__p16140446165233">Indicates that SSE-KMS is used.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p11046293165233">Type: string</p>
|
|
<p id="EN-US_TOPIC_0125560399__p32307777165233">Example: x-amz-server-side-encryption:aws:kms</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560399__p66793124165233">No. This header is mandatory when SSE-KMS is used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row37370995101841"><td class="cellrowborder" valign="top" width="24.09%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560399__p38261099165233">x-amz-server-side-encryption-aws-kms-key-id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.58%" headers="mcps1.3.13.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560399__p12141351165233">Indicates the master key ID. This header is used in SSE-KMS mode. If the customer does not provide the master key, the default master key will be used.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p42163295165233">Type: string</p>
|
|
<p id="EN-US_TOPIC_0125560399__p73991784117">Example: x-amz-server-side-encryption-aws-kms-key-id:arn:aws:kms:sichuan:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560399__p1182970165233">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row483319101847"><td class="cellrowborder" valign="top" width="24.09%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560399__p22293922165233">x-amz-server-side-encryption-customer-algorithm</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.58%" headers="mcps1.3.13.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560399__p60977246165233">Indicates an encryption algorithm. The header is used in SSE-C mode.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p11924302165233">Type: string</p>
|
|
<p id="EN-US_TOPIC_0125560399__p40209854165233">Example: x-amz-server-side-encryption-customer-algorithm:AES256</p>
|
|
<p id="EN-US_TOPIC_0125560399__p26344367165233">Constraints: This header must be used together with <strong id="EN-US_TOPIC_0125560399__b35772714165233">x-amz-server-side-encryption-customer-key</strong> and <strong id="EN-US_TOPIC_0125560399__b53518977165233">x-amz-server-side-encryption-customer-key-MD5</strong>.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560399__p40069867165233">No. This header is mandatory when SSE-C is used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row10298317101850"><td class="cellrowborder" valign="top" width="24.09%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560399__p18577739165233">x-amz-server-side-encryption-customer-key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.58%" headers="mcps1.3.13.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560399__p28401914165233">Indicates a key used to encrypt objects. The header is used in SSE-C mode.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p54290637165233">Type: string</p>
|
|
<p id="EN-US_TOPIC_0125560399__p18853693165233">Example: x-amz-server-side-encryption-customer-key:K7QkYpBkM5+hcs27fsNkUnNVaobncnLht/rCB2o/9Cw=</p>
|
|
<p id="EN-US_TOPIC_0125560399__p35465514165233">Constraints: This header is a base64-encoded 256-bit or 512-bit key and must be used together with <strong id="EN-US_TOPIC_0125560399__b50754173165233">x-amz-server-side-encryption-customer-algorithm</strong> and <strong id="EN-US_TOPIC_0125560399__b54134375165233">x-amz-server-side-encryption-customer-key-MD5</strong>.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560399__p22808236165233">No. This header is mandatory when SSE-C is used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row58340811101911"><td class="cellrowborder" valign="top" width="24.09%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560399__p51315127165233">x-amz-server-side-encryption-customer-key-MD5</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.58%" headers="mcps1.3.13.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560399__p62884600165233">Indicates the MD5 value of a key used to encrypt objects. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p29090495165233">Type: string</p>
|
|
<p id="EN-US_TOPIC_0125560399__p60487871165233">Example: x-amz-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==</p>
|
|
<p id="EN-US_TOPIC_0125560399__p7519927165233">Constraints: This header is a base64-encoded 128-bit MD5 value and must be used together with <strong id="EN-US_TOPIC_0125560399__b570481165233">x-amz-server-side-encryption-customer-algorithm</strong> and <strong id="EN-US_TOPIC_0125560399__b5134335165233">x-amz-server-side-encryption-customer-key</strong>.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560399__p13227967165233">No. This header is mandatory when SSE-C is used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row12141032102819"><td class="cellrowborder" valign="top" width="24.09%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560399__p1721163362816">x-amz-security-token</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.58%" headers="mcps1.3.13.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560399__p221119335284">Header field used to identify the request of a federated user. When the federal authentication function is enabled, users sending such requests are identified as federated users.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p162111233152811">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560399__p112111033132816">Optional. This parameter must be carried in the request sent by federated users.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row372010221134"><td class="cellrowborder" valign="top" width="24.09%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560399__p5180191819182"><span style="color:#494949;">x-amz-object-lock-mode</span></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.58%" headers="mcps1.3.13.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560399__p6180918151813">WORM mode that will be applied to the object. Currently, only <strong id="EN-US_TOPIC_0125560399__b3645183481914">COMPLIANCE</strong> is supported. This header must be used together with <strong id="EN-US_TOPIC_0125560399__b20678132292017">x-amz-object-lock-retain-until-date</strong>.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p14496145181918">Type: string</p>
|
|
<p id="EN-US_TOPIC_0125560399__p154228537191">Example: <strong id="EN-US_TOPIC_0125560399__b1534613339474">x-amz-object-lock-mode:COMPLIANCE</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560399__p2180181810184">No, but required when <strong id="EN-US_TOPIC_0125560399__b17286940194118">x-amz-object-lock-retain-until-date</strong> is present.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row165128261231"><td class="cellrowborder" valign="top" width="24.09%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560399__p14809920131812"><span style="color:#494949;">x-amz-object-lock-retain-until-date</span></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.58%" headers="mcps1.3.13.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560399__p97201718162111">Indicates the expiration time of the Object Lock retention. The value must be a UTC time that complies with ISO 8601, for example, <strong id="EN-US_TOPIC_0125560399__b814182742914">2015-07-01T04:11:15Z</strong>. This header must be used together with <strong id="EN-US_TOPIC_0125560399__b01410270294">x-amz-object-lock-mode</strong>.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p1972081822113">Type: string</p>
|
|
<p id="EN-US_TOPIC_0125560399__p372031872119">Example: <strong id="EN-US_TOPIC_0125560399__b2393113813470">x-amz-object-lock-retain-until-date:2015-07-01T04:11:15Z</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560399__p080992031813">No, but required when <strong id="EN-US_TOPIC_0125560399__b15381950192919">x-amz-object-lock-mode</strong> is present.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section35980049"><h4 class="sectiontitle">Request Elements</h4><p id="EN-US_TOPIC_0125560399__p48513771">This request involves no elements. Its body contains only the content of the requested object.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section20366724"><h4 class="sectiontitle">Response Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560399__screen46832064111238">HTTP/1.1 status_code
|
|
Server: Server Name
|
|
x-amz-request-id: request id
|
|
x-amz-id-2: id
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
ETag: etag
|
|
Date: date
|
|
Content-Length: length
|
|
Content-Type: type</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section49082792"><h4 class="sectiontitle">Response Headers</h4><p id="EN-US_TOPIC_0125560399__p46160547">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>
|
|
<p id="EN-US_TOPIC_0125560399__p29498151">This response also uses optional headers, as described in <a href="#EN-US_TOPIC_0125560399__table8944551125949">Table 2</a>.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560399__table8944551125949"></a><a name="table8944551125949"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560399__table8944551125949" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Optional response headers</caption><thead align="left"><tr id="EN-US_TOPIC_0125560399__row49696704125949"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.16.4.2.3.1.1"><p id="EN-US_TOPIC_0125560399__p9155250125954">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.16.4.2.3.1.2"><p id="EN-US_TOPIC_0125560399__p186203125954">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560399__row61967414125949"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.16.4.2.3.1.1 "><p id="EN-US_TOPIC_0125560399__p151958931300">x-amz-version-id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.16.4.2.3.1.2 "><p id="EN-US_TOPIC_0125560399__p456268941300">Indicates the version ID of an object. The version ID of an object will be returned if the bucket housing the object has versioning enabled.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p424289971300">Type: String</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row53835842102025"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.16.4.2.3.1.1 "><p id="EN-US_TOPIC_0125560399__p30672596165320">x-amz-server-side-encryption</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.16.4.2.3.1.2 "><p id="EN-US_TOPIC_0125560399__p1452353165320">This header is included in a response if SSE-KMS is used.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p13071183165320">Type: string</p>
|
|
<p id="EN-US_TOPIC_0125560399__p50531787165320">Example: x-amz-server-side-encryption:aws:kms</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row11959653102029"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.16.4.2.3.1.1 "><p id="EN-US_TOPIC_0125560399__p62015525165320">x-amz-server-side-encryption-aws-kms-key-id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.16.4.2.3.1.2 "><p id="EN-US_TOPIC_0125560399__p57201653165320">Indicates the master key ID. This header is included in a response if SSE-KMS is used.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p18715217104213">Example: x-amz-server-side-encryption-aws-kms-key-id:arn:aws:kms:sichuan:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row43117683102033"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.16.4.2.3.1.1 "><p id="EN-US_TOPIC_0125560399__p27282471165320">x-amz-server-side-encryption-customer-algorithm</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.16.4.2.3.1.2 "><p id="EN-US_TOPIC_0125560399__p62396504165320">Indicates an encryption algorithm. This header is included in a response if SSE-C is used.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p24697627165320">Type: string</p>
|
|
<p id="EN-US_TOPIC_0125560399__p20952058165320">Example: x-amz-server-side-encryption-customer-algorithm:AES256</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row35024478102037"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.16.4.2.3.1.1 "><p id="EN-US_TOPIC_0125560399__p40338394165320">x-amz-server-side-encryption-customer-key-MD5</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.16.4.2.3.1.2 "><p id="EN-US_TOPIC_0125560399__p46184492165320">Indicates the MD5 value of a key used to encrypt objects. This header is included in a response if SSE-C is used.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p13007251165320">Type: string</p>
|
|
<p id="EN-US_TOPIC_0125560399__p49956395165320">Example: x-amz-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560399__row366835349589"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.16.4.2.3.1.1 "><p id="EN-US_TOPIC_0125560399__p1717259495813">x-amz-storage-class</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.16.4.2.3.1.2 "><p id="EN-US_TOPIC_0125560399__p3516896295847">This header is returned when the storage class of an object is not Standard.</p>
|
|
<p id="EN-US_TOPIC_0125560399__p4914001095856">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560399__p4880287995813">Valid values: <strong id="EN-US_TOPIC_0125560399__b3657273395813">STANDARD_IA</strong> and <strong id="EN-US_TOPIC_0125560399__b6071914595813">GLACIER</strong></p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section39091944"><h4 class="sectiontitle">Response Elements</h4><p id="EN-US_TOPIC_0125560399__p47548937">This response involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section16283183"><h4 class="sectiontitle">Error Responses</h4><p id="EN-US_TOPIC_0125560399__p26258720">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_0125560399__section54232646"><h4 class="sectiontitle">Sample Request</h4><pre class="screen" id="EN-US_TOPIC_0125560399__screen46027481111528">PUT /object02 HTTP/1.1
|
|
User-Agent: Jakarta Commons-HttpClient/3.1
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Date: Sat, 03 Dec 2011 07:12:31 +0000
|
|
Authorization: AWS BF6C09F302931425E9A7:KUxrlwKGWYpUOTgwNxIHALsRdT4=
|
|
x-amz-meta-key: value
|
|
Content-Length: 256
|
|
|
|
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section18331773"><h4 class="sectiontitle">Sample Request for Redirecting Object Location</h4><pre class="screen" id="EN-US_TOPIC_0125560399__screen28293347111934">PUT /object02 HTTP/1.1
|
|
User-Agent: Jakarta Commons-HttpClient/3.1
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Date: Sat, 03 Dec 2011 07:12:31 +0000
|
|
Authorization: AWS BF6C09F302931425E9A7:KUxrlwKGWYpUOTgwNxIHALsRdT4=
|
|
x-amz-meta-key: value
|
|
Content-Length: 256
|
|
x-amz-website-redirect-location: www.example.com
|
|
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section30768229"><h4 class="sectiontitle">Sample Response for Uploading Objects to a Bucket with No Versioning Configured</h4><pre class="screen" id="EN-US_TOPIC_0125560399__screen19705974111545">HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-amz-request-id: 001B21A61C6C0000013402C4616D5285
|
|
x-amz-id-2: MDAxQjIxQTYxQzZDMDAwMDAxMzQwMkM0NjE2RDUyODVBQUFBQUFBQWJiYmJiYmJi
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon
|
|
Technologies, Inc
|
|
Content-Type: text/xml
|
|
ETag: "33bee59f4c1f859a7aedd36779b321cf"
|
|
Date: Sat, 03 Dec 2011 07:12:31 GMT
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section8478608"><h4 class="sectiontitle">Sample Response for Uploading Objects to a Bucket with Versioning Enabled</h4><pre class="screen" id="EN-US_TOPIC_0125560399__screen50602459111559">HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-amz-request-id: DCD2FC9CAB78000001438AB633CF1A73
|
|
x-amz-id-2: zvOE6GmblPrMk544Fg7BEt4LAmwdRuPx5s2qDVeGHZZJhUMmdxKsW4MzeJLkoVvX
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
Content-Type: text/xml
|
|
ETag: "ba1f2511fc30423bdbb183fe33f3dd0f"
|
|
x-amz-version-id: AAABQ4q2M9_c0vycq3gAAAAAVURTRkha
|
|
Date: Mon, 13 Jan 2014 08:27:13 GMT
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section9198616"><h4 class="sectiontitle">Sample Response for Uploading Objects to a Bucket with Versioning Suspended</h4><pre class="screen" id="EN-US_TOPIC_0125560399__screen43092599111614">HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-amz-request-id: DCD2FC9CAB78000001439A51DB2B2577
|
|
x-amz-id-2: GcVgfeOJHx8JZHTHrRqkPsbKdB583fYbr3RBbHT6mMrBstReVILBZbMAdLiBYy1l
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
Content-Type: text/xml
|
|
ETag: "0b55edbacf50d5086ea83ee08e55cbbd"
|
|
Date: Thu, 13 Jan 2014 09:11:32 GMT
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section66011687493"><h4 class="sectiontitle">Sample Request for Uploading an Object (with a WORM Retention Policy Configured)</h4><pre class="screen" id="EN-US_TOPIC_0125560399__screen1886417196504">PUT /object01 HTTP/1.1
|
|
User-Agent: curl/7.29.0
|
|
Host: examplebucket.obs.region.example.com
|
|
Accept: */*
|
|
Date: WED, 01 Jul 2015 04:11:15 GMT
|
|
Authorization: authorization
|
|
Content-Length: 10240
|
|
<span style="color:#494949;">x-amz-object-lock-mode:</span><span style="color:#494949;">COMPLIANCE</span>
|
|
<span style="color:#494949;">x-amz-object-lock-retain-until-date</span>:<span style="color:#494949;">2022-09-24T16:10:25Z</span>
|
|
Expect: 100-continue
|
|
|
|
<em id="EN-US_TOPIC_0125560399__i499711468508">[1024 Byte data content]</em></pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560399__section1848934125211"><h4 class="sectiontitle">Sample Response for Uploading an Object (with a WORM Retention Policy Configured)</h4><div class="codecoloring" codetype="Xml" id="EN-US_TOPIC_0125560399__screen738417546526"><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>BF2600000164364C10805D385E1E3C67
|
|
ETag:<span class="w"> </span>"d41d8cd98f00b204e9800998ecf8427e"
|
|
x-amz-id-2:<span class="w"> </span>32AAAWJAMAABAAAQAAEAABAAAQAAEAABCTzu4Jp2lquWuXsjnLyPPiT3cfGhqPoY
|
|
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:11:15<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_0125560489.html">Operations on Objects</a></div>
|
|
</div>
|
|
</div>
|
|
|