Available in Classic and VPC
Register a new lifecycle rule on an Ncloud Storage bucket or overwrite an existing lifecycle rule.
It is only available in a bucket with version control enabled. When version control is turned off, lifecycle rules don't work, even if you have lifecycle settings.
Request
This section describes the request format. The method and URI are as follows:
Method | URL |
---|---|
PUT | - |
Request headers
For information about the headers common to all Ncloud Storage APIs, see Ncloud Storage request headers.
Request body
You can include the following data in the body of your request:
Field | Type | Required | Description |
---|---|---|---|
Rule | list of structure | Y | List of rules, up to 1000 rules |
Rule.ID | string | N | Rule name, up to 255 characters |
Rule.Filter | structure | N | Filter to distinguish which objects to apply the rule to |
Rule.Filter.Prefix | string | N | Prefix of the object to apply the rule to, currently only filterable by prefix |
Rule.Expiration | structure | N | Expiration rule |
Rule.Expiration.Days | integer | N | Number of days the object is deleted after being created, which must be a positive integer greater than 0 |
Rule.Transition | list of structure | N | Storage class migration rule |
Rule.Transition.Days | integer | N | Number of days after the object is created that it is switched to the specified storage class, which must be a positive integer |
Rule.Transition.StorageClass | string | N | Storage class to be switched toDEEP_ARCHIVE : Archive Class |
Rule.NoncurrentVersionExpiration | structure | N | Expiration rule for non-current object versions |
Rule.NoncurrentVersionExpiration.NewerNoncurrentVersions | interger | N | Number of non-current versions to archive, up to 100 |
Rule.NoncurrentVersionExpiration.NoncurrentDays | integer | N | Number of days the object remains noncurrent, which must be a positive integer greater than 0 |
Rule.NoncurrentVersionTransition | list of structure | N | Storage class migration rule for non-current object versions |
Rule.NoncurrentVersionTransition.NewerNoncurrentVersions | integer | N | Number of non-current versions to keep in the same storage class before switching the object, up to 100 |
Rule.NoncurrentVersionTransition.NoncurrentDays | integer | N | Number of days the object will remain noncurrent, which must be a positive integer |
Rule.NoncurrentVersionTransition.StorageClass | string | N | Storage class to be switched toDEEP_ARCHIVE : Archive Class |
Request example
The request example is as follows:
PUT /?lifecycle HTTP/1.1
Host: bucket.kr.ncloudstorage.com
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Rule>
<ID>string</ID>
<Filter>
<Prefix>string</Prefix>
</Filter>
<Expiration>
<Days>integer</Days>
</Expiration>
<Transition>
<Days>integer</Days>
<StorageClass>string</StorageClass>
</Transition>
<NoncurrentVersionExpiration>
<NewerNoncurrentVersions>integer</NewerNoncurrentVersions>
<NoncurrentDays>integer</NoncurrentDays>
</NoncurrentVersionExpiration>
<NoncurrentVersionTransition>
<NewerNoncurrentVersions>integer</NewerNoncurrentVersions>
<NoncurrentDays>integer</NoncurrentDays>
<StorageClass>string</StorageClass>
</NoncurrentVersionTransition>
...
</Rule>
...
</LifecycleConfiguration>
Response
This section describes the response format.
Response headers
For information about the headers common to all Ncloud Storage APIs, see Ncloud Storage response headers.
Response status codes
For information about the HTTP status codes common to all Ncloud Storage APIs, see Common Ncloud Storage response status codes.
Response example
The response example is as follows:
HTTP/1.1 200 OK