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.
Attributes
TIME_UNIT_DAYS
A constant which can be used with the time_unit property of a ObjectLifecycleRule. TIME_UNIT_YEARS
A constant which can be used with the time_unit property of a ObjectLifecycleRule. action
[Required] Gets the action of this ObjectLifecycleRule. is_enabled
[Required] Gets the is_enabled of this ObjectLifecycleRule. name
[Required] Gets the name of this ObjectLifecycleRule. object_name_filter
Gets the object_name_filter of this ObjectLifecycleRule. target
Gets the target of this ObjectLifecycleRule. time_amount
[Required] Gets the time_amount of this ObjectLifecycleRule. time_unit
[Required] Gets the time_unit of this ObjectLifecycleRule. Methods
__init__
(**kwargs)Initializes a new ObjectLifecycleRule object with values from keyword arguments. -
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.
- target (str) – The value to assign to the target 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 (oci.object_storage.models.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 from Standard and InfrequentAccess storage tiers into the Archive storage tier. Rules using the action ‘INFREQUENT_ACCESS’ move objects from Standard storage tier into the Infrequent Access Storage tier. Objects that are already in InfrequentAccess tier or in Archive tier are left untouched. Rules using the action ‘DELETE’ permanently delete objects from buckets. Rules using ‘ABORT’ abort the uncommitted multipart-uploads and permanently delete their parts from buckets.
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.
Returns: The object_name_filter of this ObjectLifecycleRule. Return type: oci.object_storage.models.ObjectNameFilter
-
target
¶ Gets the target of this ObjectLifecycleRule. The target of the object lifecycle policy rule. The values of target can be either “objects”, “multipart-uploads” or “previous-object-versions”. This field when declared as “objects” is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for objects. This field when declared as “previous-object-versions” is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for previous versions of existing objects. This field when declared as “multipart-uploads” is used to specify the ABORT (only) rule for uncommitted multipart-uploads.
Returns: The target of this ObjectLifecycleRule. Return type: str
-
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
-