Updated on 2024-10-24 GMT+08:00

Lifecycle Configuration Elements

The following uses an example to describe the elements of a lifecycle rule.

Elements of a lifecycle rule

A complete lifecycle rule consists of a range of elements that fall into metadata, filters, and actions (execution time included).

Metadata

Rule metadata describes the rule ID and rule status.

Table 1 Metadata elements

Element

Description

Metadata

ID

Definition:

Rule ID, which uniquely identifies a rule.

Value range:

The value is a string ranging from 0 (exclusive) to 255 characters. It can contain only uppercase or lowercase letters, digits, periods (.), underscores (_), and hyphens (-).

Default value:

If the ID element is not used or is left blank, OBS automatically assigns a unique ID to the rule.

Status

Definition:

It indicates whether the rule is enabled or disabled. If the rule is disabled, OBS does not perform any actions defined in the rule.

Value range:

  • Enabled: The rule is enabled.
  • Disabled: The rule is disabled.

Default value:

N/A

Filters

The object filter criteria of a rule describe the objects to which a lifecycle rule is applied.

Table 2 Filter description

Element

Description

Filter

Prefix

Definition:

Object name prefix, which identifies the objects to which the lifecycle rule applies

If you leave the Prefix element blank, the rule applies to all objects in the bucket.

Value range:

The value is a string ranging from 0 (exclusive) to 1024 characters.

Default value:

If this element is not specified, it is left blank by default.

Actions

The following table describes actions that will be performed on objects and when the actions will be performed.

Table 3 Elements to describe lifecycle actions

Element

Description

Sub-elements

Description

Expiration

Used to delete objects

NOTE:

The Expiration action does not delete unassembled multipart uploads.

Days

(Use only one of the Days, Date, and ExpiredObjectDeleteMarker elements.)

Definition:

The number of days since the last object update, after which eligible objects will be expired and then deleted

Constraints:

  • Days applies only to the current version of an object.
  • For the same object, the time specified for Expiration must be later than that for Transition.

Value range:

A positive integer, in days

Default value:

N/A

Date

(Use only one of the Days, Date, and ExpiredObjectDeleteMarker elements.)

Definition:

The date, before which objects were last modified will be expired and then deleted

Constraints:

  • Date applies only to the current version of an object.
  • The date must be compliant with ISO 8601 and its time must be 00:00:00 in UTC. If Date is set to 2018-01-01T00:00:00.000Z, objects whose last modification time is earlier than 2018-01-01T00:00:00.000Z will be deleted.
  • For the same object, the time specified for Expiration must be later than that for Transition.
  • OBS Console and OBS Browser+ do not support the deletion of objects on a specified date.

Default value:

N/A

Used to remove expired delete markers

ExpiredObjectDeleteMarker

(Use only one of the Days, Date, and ExpiredObjectDeleteMarker elements.)

Definition:

Whether to remove expired delete markers

Value range:

  • true: Expired delete markers are removed.
  • false: Expired delete markers are not removed.

Default value:

N/A

Transition

Used to transition objects between storage classes

Days

(Use either Days or Date.)

Definition:

The number of days since the last object update, after which eligible objects will be transitioned to another storage class

Constraints:

Days applies only to the current version of an object.

Value range:

Unit: day

  • If only one transition is configured, the time should be at least one day after the update.
  • If multiple transitions are configured, the transition to the Deep Archive storage class must be later than the transition to Archive, and the transition to Archive must be later than the transition to Infrequent Access.

Default value:

N/A

Date

(Use either Days or Date.)

Definition:

The date, before which objects were last modified will be transitioned to another storage class

Constraints:

  • Date applies only to the current version of an object.
  • The date must be compliant with ISO 8601 and its time must be 00:00:00 in UTC. If Date is set to 2018-01-01T00:00:00.000Z, objects whose last modification time is earlier than 2018-01-01T00:00:00.000Z will be transitioned to another storage class.
  • If multiple transitions are configured, the transition to the Deep Archive storage class must be later than the transition to Archive, and the transition to Archive must be later than the transition to Infrequent Access.
  • OBS Console and OBS Browser+ do not support the transition of objects on a specified date.

Default value:

N/A

StorageClass

Definition:

New storage class eligible objects will be transitioned to

Value range:

  • WARM: the Infrequent Access storage class
  • COLD: the Archive storage class
  • DEEP_ARCHIVE: the Deep Archive storage class

Default value:

N/A

AbortIncompleteMultipartUpload

Used to delete fragments

DaysAfterInitiation

Definition:

The number of days since fragment generation, after which fragments will be expired and then deleted

Value range:

A positive integer, in days

Default value:

N/A

NoncurrentVersionExpiration

Used to delete historical object versions

NoncurrentDays

Definition:

The number of days since the objects became noncurrent, after which noncurrent object versions will be deleted

Constraints:

  • NoncurrentDays only applies to historical object versions.
  • NoncurrentDays can only be used for buckets that have versioning enabled or suspended.
  • For the same historical version of an object, the time specified for Expiration must be later than that for Transition.

Value range:

A positive integer, in days

Default value:

N/A

NoncurrentVersionTransition

Used to transition noncurrent versions

NoncurrentDays

Definition:

The number of days since the objects became noncurrent, after which noncurrent object versions will be transitioned to another storage class

Constraints:

  • NoncurrentDays only applies to historical object versions.
  • NoncurrentDays can only be used for buckets that have versioning enabled or suspended.

Value range:

Unit: day

  • If only one transition is involved, the time should be at least one day after the update.
  • If multiple transitions are involved, the latter transition should be at least one day later than the former transition.
  • If multiple transitions are configured, the transition to the Deep Archive storage class must be later than the transition to Archive, and the transition to Archive must be later than the transition to Infrequent Access.

Default value:

N/A

StorageClass

Definition:

New storage class eligible historical object versions will be transitioned to

Value range:

  • WARM: the Infrequent Access storage class
  • COLD: the Archive storage class
  • DEEP_ARCHIVE: the Deep Archive storage class

Default value:

N/A

In the same lifecycle rule, Days or Date must be consistently used. If you use Days for Expiration, you must also use Days (rather than Date) for Transition, and vice versa.