PUT /?lifecycle HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comContent-Length: lengthDate: GMT DateAuthorization: Auth StringContent-MD5: MD5
<LifecycleConfiguration><Rule><ID>String</ID><Filter><And><Prefix>String</Prefix><PrefixNotEquals>String</PrefixNotEquals><Tag><Key>String</Key><Value>String</Value></Tag><ObjectSizeGreaterThan>Integer</ObjectSizeGreaterThan><ObjectSizeLessThan>Integer</ObjectSizeLessThan></And></Filter><Status>String</Status><Transition><Days>Integer</Days><StorageClass>String</StorageClass></Transition><NoncurrentVersionExpiration><NoncurrentDays>Integer</NoncurrentDays></NoncurrentVersionExpiration></Rule><Rule><ID>String</ID><Filter><Prefix>String</Prefix></Filter><Status>String</Status><Transition><Days>Integer</Days><StorageClass>String</StorageClass></Transition><NoncurrentVersionTransition><NoncurrentDays>Integer</NoncurrentDays><StorageClass>String</StorageClass></NoncurrentVersionTransition></Rule><Rule><ID>String</ID><Filter><Prefix>String</Prefix></Filter><Status>String</Status><Expiration><ExpiredObjectDeleteMarker>Boolean</ExpiredObjectDeleteMarker></Expiration><NoncurrentVersionExpiration><NoncurrentDays>Integer</NoncurrentDays></NoncurrentVersionExpiration><AbortIncompleteMultipartUpload><DaysAfterInitiation>Integer</DaysAfterInitiation></AbortIncompleteMultipartUpload></Rule><Rule><ID>String</ID><Filter><And><Prefix>String</Prefix><PrefixNotEquals>String</PrefixNotEquals></And></Filter><Status>String</Status><Transition><AccessFrequency><AccessCountLessThan>Container</AccessCountLessThan><RecentDays>Integer</RecentDays></AccessFrequency><StorageClass>String</StorageClass></Transition><NoncurrentVersionTransition><AccessFrequency><AccessCountLessThan>Container</AccessCountLessThan><RecentDays>Integer</RecentDays></AccessFrequency><StorageClass>String</StorageClass></NoncurrentVersionTransition></Rule></LifecycleConfiguration>
Node Name (Keyword) | Parent Node | Description | Type | Required |
LifecycleConfiguration | None | Lifecycle configuration. | Container | Yes |
Rule | LifecycleConfiguration | Rule Description | Container | Yes |
ID | LifecycleConfiguration.Rule | Uniquely identifies a rule. The length cannot exceed 255 characters. | String | No |
Filter | LifecycleConfiguration.Rule | Filter describes the object set affected by the rule. | Container | No |
And | LifecycleConfiguration.Rule .Filter | A subset of the object filter. This element is required only when multiple filtering rules need to be specified, for example: specifying both Prefix and Tag filters, or specifying multiple Tag filters simultaneously. | Container | No |
Prefix | LifecycleConfiguration.Rule .Filter.And | Specifies the prefix to which the rule applies. Objects matching the prefix are affected by this rule, supporting at most one prefix. | String | No |
PrefixNotEquals | LifecycleConfiguration.Rule.Filter.And | Filters Objects whose Prefix does not match the specified string. Only one PrefixNotEquals is allowed, and its scope is a subset of Prefix. | String | No |
ObjectSizeGreaterThan | LifecycleConfiguration.Rule
.Filter.And | Filters objects whose size must be greater than a specified value (excluding equal), measured in Bytes. Note: The value of ObjectSizeGreaterThan must be greater than or equal to 65536. If a rule's Filter contains a condition for filtering by object size, that rule cannot simultaneously include the AbortIncompleteMultipartUpload and ExpiredObjectDeleteMarker actions. | Integer | No |
ObjectSizeLessThan | LifecycleConfiguration.Rule
.Filter.And | Filters objects whose size must be less than a specified value (excluding equal), measured in Bytes. Note: The value of ObjectSizeLessThan must be greater than or equal to 65537. The value of ObjectSizeLessThan must be greater than the value of ObjectSizeGreaterThan. If a rule's Filter contains a condition for filtering by object size, that rule cannot simultaneously include the AbortIncompleteMultipartUpload and ExpiredObjectDeleteMarker actions. | Integer | No |
Tag | LifecycleConfiguration.Rule .Filter.And | A collection of Tags, supporting up to 10 Tags. | Container | No |
Key | LifecycleConfiguration.Rule .Filter.And.Tag | The Key of a Tag, with a length not exceeding 128 bytes, supporting English letters, numbers, spaces, plus signs, minus signs, underscores, equal signs, periods, colons, and slashes. Minus signs, underscores, equal signs, periods, colons, and slashes. | String | No |
Value | LifecycleConfiguration.Rule .Filter.And.Tag | The Value of a Tag, with a length not exceeding 256 bytes, supporting English letters, numbers, spaces, plus signs, minus signs, underscores, equal signs, periods, colons, and slashes. Minus signs, underscores, equal signs, periods, colons, and slashes. | String | No |
Status | LifecycleConfiguration.Rule | Indicates whether the rule is enabled. Valid values: Enabled, Disabled. | String | Yes |
Expiration | LifecycleConfiguration.Rule | The expiration attribute of a rule. You can configure it together with the Transition attribute (the rule transition attribute) or choose to configure only one of these attributes. | Container | No |
ExpiredObjectDeleteMarker | LifecycleConfiguration.Rule .Expiration | Deletes deletion markers that have no version history. Valid values: true, false. true: indicates the deletion of deletion markers that have no version history. false: indicates that deletion markers with no version history are not deleted. Note: Within a single rule, you cannot simultaneously configure the parameter for deleting the current version. This parameter takes effect only when the NoncurrentVersionsExpiration rule is also configured within the same rule. | Boolean | No |
Transition | LifecycleConfiguration.Rule | The transition attribute of a rule, describing when an object transitions to a different storage class and what the target storage class is. You can configure it together with the Expiration attribute (the rule expiration attribute) or choose to configure only one of these attributes. | Container | No |
Days | LifecycleConfiguration.Rule .Transition or .Expiration | Specifies the number of days after the object's last modification date when the action corresponding to the rule is performed. For Transition, the valid value for this field is a non-negative integer. The maximum supported duration is 3650 days. For Expiration, the valid value for this field is a positive integer, with a maximum supported duration of 3650 days. | Integer | No |
AccessFrequency | Transition or NoncurrentVersionTransition | Specifies lifecycle rules based on access time. After this field is configured, fields related to last modification time (Days and NoncurrentDays) cannot be configured. Note: | Container | No |
RecentDays | AccessFrequency | Indicates the number of consecutive access days, which must not exceed 365. AccessCountLessThan must be configured together with this field, indicating that objects are transitioned when the number of accesses within the specified consecutive days is below a certain threshold. Fields related to last modification time (Days and NoncurrentDays) cannot be configured. | Integer | Yes |
AccessCountLessThan | AccessFrequency | Indicates the number of times an object is accessed, with a default value of 1. RecentDays must be configured together with this field, indicating that objects are transitioned when the number of accesses within the specified consecutive days is below a certain threshold. Fields related to last modification time (Days and NoncurrentDays) cannot be configured. | Container | Yes |
AbortIncompleteMultipartUpload | LifecycleConfiguration.Rule | Cleaning up incomplete multipart uploads and file fragments. | Container | No |
DaysAfterInitiation | LifecycleConfiguration.Rule .AbortIncompleteMultipartUpload | Specifies the number of days after a multipart upload is initiated within which it must be completed. | Integer | Yes |
NoncurrentVersionExpiration | LifecycleConfiguration.Rule | Specifies when noncurrent version objects expire. | Container | No |
NoncurrentVersionTransition | LifecycleConfiguration.Rule | Specifying when noncurrent version objects transition to a different storage class and what the target storage class is. | Container | No |
NoncurrentDays | LifecycleConfiguration.Rule .NoncurrentVersionExpiration or NoncurrentVersionTransition | Specifies the number of days after an object becomes a noncurrent version when the action corresponding to the rule is performed. For Transition, the valid value for this field is a non-negative integer. The maximum supported duration is 3650 days. For Expiration, the valid value for this field is a positive integer, with a maximum supported duration of 3650 days. | Integer | No |
StorageClass | LifecycleConfiguration.Rule Transition or NoncurrentVersionTransition | Specifies the storage class for objects after transition. Enumeration values: STANDARD_IA, MAZ_STANDARD_IA, INTELLIGENT_TIERING, MAZ_INTELLIGENT_TIERING, ARCHIVE, DEEP_ARCHIVE. For details about storage classes, see Storage Class Overview. | String | Yes |
PUT /?lifecycle HTTP/1.1Host:examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Wed, 16 Aug 2017 11:59:33 GMTAuthorization:q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1502855771;1502935771&q-key-time=1502855771;1502935771&q-header-list=content-md5;host&q-url-param-list=lifecycle&q-signature=****************************************Content-MD5: LcNUuow8OSZMrEDnvndw1Q==Content-Length: 348Content-Type: application/x-www-form-urlencoded<LifecycleConfiguration><Rule><ID>id1</ID><Filter><Prefix>documents/</Prefix></Filter><Status>Enabled</Status><Transition><Days>100</Days><StorageClass>ARCHIVE</StorageClass></Transition></Rule><Rule><ID>id2</ID><Filter><Prefix>logs/</Prefix></Filter><Status>Enabled</Status><Transition><Days>10</Days><StorageClass>STANDARD_IA</StorageClass></Transition></Rule></LifecycleConfiguration>
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 0Date: Wed, 16 Aug 2017 11:59:33 GMTServer: tencent-cosx-cos-request-id: NTk5NDMzYTRfMjQ4OGY3Xzc3NGRf****
PUT /?lifecycle HTTP/1.1Host:examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Wed, 16 Aug 2020 11:59:33 GMTAuthorization:q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1502855771;1502935771&q-key-time=1502855771;1502935771&q-header-list=content-md5;host&q-url-param-list=lifecycle&q-signature=****************************************Content-MD5: LcNUuow8OSZMrEDnvndw1Q==Content-Length: 348Content-Type: application/x-www-form-urlencoded<LifecycleConfiguration><Rule><ID>id1</ID><Filter><Prefix>documents/</Prefix></Filter><Status>Enabled</Status><Transition><AccessFrequency><AccessCountLessThan>2</AccessCountLessThan><RecentDays>7</RecentDays></AccessFrequency><StorageClass></StorageClass></Transition><NoncurrentVersionTransition><AccessFrequency><AccessCountLessThan>2</AccessCountLessThan><RecentDays>7</RecentDays></AccessFrequency><StorageClass></StorageClass></NoncurrentVersionTransition></Rule></LifecycleConfiguration>
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 0Date: Wed, 16 Aug 2020 11:59:33 GMTServer: tencent-cosx-cos-request-id: NTk5NDMzYTRfMjQ4OGY3Xzc3NGRf****
Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários