ObjectLifecycleRule

class oci.object_storage.models.ObjectLifecycleRule(**kwargs)

Bases: object

To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, talk to an administrator. If you are an administrator who needs to write policies to give users access, see Getting Started with Policies.

TIME_UNIT_DAYS = 'DAYS'

A constant which can be used with the time_unit property of a ObjectLifecycleRule. This constant has a value of "DAYS"

TIME_UNIT_YEARS = 'YEARS'

A constant which can be used with the time_unit property of a ObjectLifecycleRule. This constant has a value of "YEARS"

__init__(**kwargs)

Initializes a new ObjectLifecycleRule object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • name (str) -- The value to assign to the name property of this ObjectLifecycleRule.
  • action (str) -- The value to assign to the action property of this ObjectLifecycleRule.
  • time_amount (int) -- The value to assign to the time_amount property of this ObjectLifecycleRule.
  • time_unit (str) -- The value to assign to the time_unit property of this ObjectLifecycleRule. Allowed values for this property are: "DAYS", "YEARS", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
  • is_enabled (bool) -- The value to assign to the is_enabled property of this ObjectLifecycleRule.
  • object_name_filter (ObjectNameFilter) -- The value to assign to the object_name_filter property of this ObjectLifecycleRule.
action

[Required] Gets the action of this ObjectLifecycleRule. The action of the object lifecycle policy rule. Rules using the action 'ARCHIVE' move objects into the Archive Storage tier. Rules using the action 'DELETE' permanently delete objects from buckets. 'ARCHIVE' and 'DELETE' are the only two supported actions at this time.

Returns:The action of this ObjectLifecycleRule.
Return type:str
is_enabled

[Required] Gets the is_enabled of this ObjectLifecycleRule. A boolean that determines whether this rule is currently enabled.

Returns:The is_enabled of this ObjectLifecycleRule.
Return type:bool
name

[Required] Gets the name of this ObjectLifecycleRule. The name of the lifecycle rule to be applied.

Returns:The name of this ObjectLifecycleRule.
Return type:str
object_name_filter

Gets the object_name_filter of this ObjectLifecycleRule. A filter limiting object names that the rule will apply to.

Returns:The object_name_filter of this ObjectLifecycleRule.
Return type:ObjectNameFilter
time_amount

[Required] Gets the time_amount of this ObjectLifecycleRule. Specifies the age of objects to apply the rule to. The timeAmount is interpreted in units defined by the timeUnit parameter, and is calculated in relation to each object's Last-Modified time.

Returns:The time_amount of this ObjectLifecycleRule.
Return type:int
time_unit

[Required] Gets the time_unit of this ObjectLifecycleRule. The unit that should be used to interpret timeAmount. Days are defined as starting and ending at midnight UTC. Years are defined as 365.2425 days long and likewise round up to the next midnight UTC.

Allowed values for this property are: "DAYS", "YEARS", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.

Returns:The time_unit of this ObjectLifecycleRule.
Return type:str