tencent cloud

Cloud Object Storage

PUT Bucket IntelligentTiering

Download
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-05-19 15:59:26

Feature Description

The PUT Bucket IntelligentTiering API enables the INTELLIGENT_TIERING configuration for a bucket and sets configuration rules for the Intelligent Tiering Archive and Deep Archive tiers.
Note:
After you enable the INTELLIGENT_TIERING configuration, the rule with id=default is used to configure the infrequent access tier and enable INTELLIGENT_TIERING. This rule cannot be disabled or modified. Rules with other IDs are for the Archive and Deep Archive tiers, and they can be deleted or modified.
Only the root account or a sub-account that is granted permission for the PUT Bucket IntelligentTiering API can call this API.
You can obtain the storage tier of an object from the x-cos-storage-tier header returned by the Query Object Metadata API.

Authorization Description

Set the action to cos:PutBucketIntelligentTiering in the authorization policy. View all actions.

Id is default (Infrequent Access Tier Rule)

Description

The rule with id=default is mandatory. It enables the INTELLIGENT_TIERING feature for the bucket and configures the infrequent access tier transition rules. Once this rule is set, it cannot be deleted or overwritten. Correspondingly, the INTELLIGENT_TIERING feature for the bucket cannot be disabled. The infrequent access tier transition rules apply to the entire bucket, and the transition days for the infrequent access tier cannot be modified.

Request

Request Example

PUT /?intelligent-tiering&id=default HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Connection: keep-alive
Authorization: authorization string
Content-Type: text/plain
Content-Length: Int
Note:
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com. Here, <BucketName-APPID> is the bucket name with the APPID suffix, for example, examplebucket-1250000000. For details, see the Bucket Overview > Basic Information and Bucket Overview > Bucket Naming Conventions documents. <Region> is the available region of COS. For details, see the Regions and Access Endpoints document.
Authorization: Auth String (For details, see Request Signature).

Request Parameter

When the PUT Bucket IntelligentTiering API is called, you must use the rule name parameter. The rule name for the infrequent access tier is fixed as default.
Parameter
Description
Type
Required
id
The name of the intelligent tiering rule name list task. The default rule is fixed as the infrequent access tier rule.
String
Yes

Request Header

This API only uses common request headers. For details, see Common Request Headers.

Request Body

<IntelligentTieringConfiguration>
<Id>default</Id>
<Status>Enabled</Status>
<Tiering>
<AccessTier>INFREQUENT</AccessTier>
<Days>30|60|90</Days>
<RequestFrequent>1</RequestFrequent>
</Tiering>
</IntelligentTieringConfiguration>
The specific data content is as follows:
Name
Parent Node
Description
Type
Required
IntelligentTieringConfiguration
None
Specific information about the INTELLIGENT_TIERING configuration.
Container
Yes
Id
IntelligentTieringConfiguration
Specifies the name of the INTELLIGENT_TIERING configuration rule. The infrequent access tier rule is fixed as default.
String
Yes
Status
IntelligentTieringConfiguration
Specifies whether the intelligent tiering rule is enabled.
Valid values: Enabled, Disabled.
When the id is default, only Enabled can be set.
Enum
Yes
Tiering
IntelligentTieringConfiguration
Specifies the configuration information about data transition in the INTELLIGENT_TIERING configuration.
Container
Yes
AccessTier
IntelligentTieringConfiguration.Tiering
When the id is default, it indicates the infrequent access tier. Enumeration value: INFREQUENT.
Enum
Yes
Days
IntelligentTieringConfiguration.Tiering
Specifies the day limit for transitioning data from the standard tier to the infrequent access tier in the INTELLIGENT_TIERING configuration. The default value is 30 days. Options include 30, 60, and 90.
Int
Yes
RequestFrequent
IntelligentTieringConfiguration.Tiering
Specifies the number of accesses limit for transitioning data from the standard tier to the infrequent access tier in the configuration. The default value is 1. When it is used together with the day limit, it can achieve the transition effect.
For example, if you set this parameter to 1 and the access days to 30, it means that objects accessed fewer than 1 time in 30 consecutive days are transitioned from the standard tier to the infrequent access tier.
Int
Yes

Response

Response Headers

This API only returns common response headers. For details, see Common Response Headers.

Response Body

The response body of this API is empty.

Error Codes

This API follows unified error responses and error codes. For details, see Error Codes.

Practical Case: Enabling Intelligent Tiering and Setting Infrequent Access Tier Rules

Request
PUT /?intelligent-tiering&id=default HTTP/1.1
Host: examplebucket-1250000000.cos.ap-chengdu.myqcloud.com
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.12.4
Content-Type: application/xml
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1480932292;1981012292&q-key-time=1480932292;1981012292&q-url-param-list=versioning&q-header-list=host&q-signature=****************************************
Content-Length: 83

<IntelligentTieringConfiguration>
<Id>default</Id>
<Status>Enabled</Status>
<Tiering>
<AccessTier>INFREQUENT</AccessTier>
<Days>30</Days>
<RequestFrequent>1</RequestFrequent>
</Tiering>
</IntelligentTieringConfiguration>
Response
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 0
Connection: keep-alive
Date: Sun, 23 Aug 2020 08:14:53 GMT
Server: tencent-cos
x-cos-request-id: NTk5ZDM5N2RfMjNiMjM1MGFfMmRiX2Y0****

Id Is Not default (Rules for Archive Tier and Deep Archive Tier)

Description

Note:
You must first enable Intelligent Tiering by using the infrequent access rule with id=default before you can configure rules for the Archive and Deep Archive tiers.
Rules with an id other than default are optional. They are used to configure transition rules for the Intelligent Tiering Archive and Deep Archive tiers. You can configure multiple Archive and Deep Archive tier rules, up to a maximum of 999. You can specify prefixes and Tags to define different filter scopes. After a rule is configured, you can delete or overwrite it.

Request

Request Example

PUT /?intelligent-tiering&id=Id HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Connection: keep-alive
Authorization: authorization string
Content-Type: text/plain
Content-Length: Int
Note:
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com. Here, <BucketName-APPID> is the bucket name with the APPID suffix, for example, examplebucket-1250000000. For details, see the Bucket Overview > Basic Information and Bucket Overview > Bucket Naming Conventions documents. <Region> is the available region of COS. For details, see the Regions and Access Endpoints document.
Authorization: Auth String (For details, see Request Signature).

Request Parameter

When the PUT Bucket IntelligentTiering API is called, you must use the rule name parameter. The rule name for the infrequent access tier is fixed as default. A rule name other than default indicates a rule for the Archive or Deep Archive tier.
Parameter
Description
Type
Required
id
The name of the intelligent tiering rule name list task. Set to a string other than default, indicating that the rule is for archive tier and deep archive tier conversion.
String
Yes

Request Header

This API only uses common request headers. For details, see Common Request Headers.

Request Body

<IntelligentTieringConfiguration>
<Id>rule1</Id>
<Status>Enabled</Status>
<Filter>
<And>
<Prefix>string</Prefix>
<Tag>
<Key>string</Key>
<Value>string</Value>
</Tag>
<Tag>
<Key>string</Key>
<Value>string</Value>
</Tag>
...
</And>
</Filter>
<Tiering>
<AccessTier>ARCHIVE_ACCESS</AccessTier>
<Days>100</Days>
</Tiering>
<Tiering>
<AccessTier>DEEP_ARCHIVE_ACCESS</AccessTier>
<Days>200</Days>
</Tiering>
</IntelligentTieringConfiguration>
The specific data content is as follows:
Name
Parent Node
Description
Type
Required
Id
IntelligentTieringConfiguration
The name of the intelligent tiering rule name list task. Set to a string other than default, indicating that the rule is for archive tier and deep archive tier conversion.
String
Yes
Status
IntelligentTieringConfiguration
Specifies whether the intelligent tiering rule is enabled. Valid values: Enabled, Disabled.
When the id is default, only Enabled is supported.
Enum
Yes
Filter
IntelligentTieringConfiguration
Filters objects to be analyzed. When the id is not default, the archive and deep archive tier rules take effect on objects that match the prefix and Tag set in Filter.
Container
No
And
IntelligentTieringConfiguration.Filter
Filter condition. If both a prefix and object Tag conditions are required, wrap them with And.
Container
No
Prefix
IntelligentTieringConfiguration.Filter.And
Filters the object prefix. At most one prefix can be specified.
String
No
Tag
IntelligentTieringConfiguration.Filter.And
When objects to be analyzed are filtered, object Tags (multiple Tags are supported) can be used as filter conditions.
Container
No
Tiering
IntelligentTieringConfiguration
Specifies the configuration information about data transition in the INTELLIGENT_TIERING configuration.
Container
Yes
AccessTier
IntelligentTieringConfiguration .Tiering
When the id is not default, it specifies the archive or deep archive tier. Valid values: ARCHIVE_ACCESS, DEEP_ARCHIVE_ACCESS.
Enum
Yes
Days
IntelligentTieringConfiguration .Tiering
When the id is not default, it specifies the number of days after which data is transitioned to the archive or deep archive tier in the INTELLIGENT_TIERING configuration.
The Archive tier (ARCHIVE_ACCESS) supports a configurable range from 91 to 730 days.
The Deep Archive tier (DEEP_ARCHIVE_ACCESS) supports a configurable range from 180 to 730 days.
Within the same rule, the number of days for the Deep Archive tier must be greater than that for the Archive tier.
Int
Yes

Response

This API only returns common response headers. For details, see Common Response Headers.

Response Body

The response body of this API is empty.

Error Codes

This API follows unified error responses and error codes. For details, see Error Codes.

Case 1: Enabling Archival and Deep Archival Tier Configurations for an Entire Bucket

For Intelligent Tiering objects, configure them to transition to the Archive tier after 100 consecutive days without access, and to the Deep Archive tier after 200 consecutive days without access.

Request

PUT /?intelligent-tiering&id=rule1 HTTP/1.1
Host: examplebucket-1250000000.cos.ap-chengdu.myqcloud.com
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.12.4
Content-Type: application/xml
Authorization: Auth String
Content-Length: Content Length

<IntelligentTieringConfiguration>
<Id>rule1</Id>
<Status>Enabled</Status>
<Tiering>
<AccessTier>ARCHIVE_ACCESS</AccessTier>
<Days>100</Days>
</Tiering>
<Tiering>
<AccessTier>DEEP_ARCHIVE_ACCESS</AccessTier>
<Days>200</Days>
</Tiering>
</IntelligentTieringConfiguration>

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 0
Connection: keep-alive
Date: Sun, 23 Aug 2020 08:14:53 GMT
Server: tencent-cos
x-cos-request-id: NTk5ZDM5N2RfMjNiMjM1MGFfMmRi1111****

Case 2: Enabling Archival Tier Configuration for a Specified Prefix

Configure Intelligent Tiering objects with the prefix folder1/ to transition to the Archive tier after 91 consecutive days without access.

Request

PUT /?intelligent-tiering&id=rule2 HTTP/1.1
Host: examplebucket-1250000000.cos.ap-chengdu.myqcloud.com
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.12.4
Content-Type: application/xml
Authorization: Auth String
Content-Length: Content Length

<IntelligentTieringConfiguration>
<Id>rule2</Id>
<Status>Enabled</Status>
<Filter>
<Prefix>folder1/</Prefix>
</Filter>
<Tiering>
<AccessTier>ARCHIVE_ACCESS</AccessTier>
<Days>91</Days>
</Tiering>
</IntelligentTieringConfiguration>

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 0
Connection: keep-alive
Date: Sun, 23 Aug 2020 08:14:53 GMT
Server: tencent-cos
x-cos-request-id: NTk5ZDM5N2RfMjNiMjM1MGFfMmRi222****

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan