Set object storage class

To change an object's storage class with the XML API, you must overwrite the existing object (creating a new object version). Make a PUT request that is scoped to the object. The request should contain the x-goog-storage-class reference header, as well as the object in the request body. Note that based on the location of the bucket in which the object resides, there are restrictions on the storage class you can set for the object.

To learn more about per-object storage classes in general, see the associated concept page.

Request headers

In addition to common request headers, the following can be used.

Header Description Required
x-goog-storage-class A valid storage class. No

Request body elements

The request body contains the object data.

Request syntax

The following syntax applies to PUT Object requests that use the x-goog-storage-class header.

PUT /<object> HTTP/1.1
Host: <bucket>.storage.googleapis.com
Date: <date>
Content-Length: <request body length>
Content-Type: <MIME type>
Authorization: <authentication string>
x-goog-storage-class: <storage class>

Response headers

The request can return a variety of response headers depending on the request headers you use.

Response body elements

The response does not include an XML document in the response body.

此页内容是否有用?请给出您的反馈和评价:

发送以下问题的反馈:

此网页
Cloud Storage
需要帮助?请访问我们的支持页面