Class: Google::Cloud::Storage::Bucket::Lifecycle::Rule
- Inherits:
-
Object
- Object
- Google::Cloud::Storage::Bucket::Lifecycle::Rule
- Defined in:
- lib/google/cloud/storage/bucket/lifecycle.rb
Overview
Bucket Lifecycle Rule
Represents an Object Lifecycle Management rule for a bucket. The action for the rule will be taken when its conditions are met. Accessed via Google::Cloud::Storage::Bucket#lifecycle.
Instance Attribute Summary collapse
-
#action ⇒ String
The type of action taken when the rule's conditions are met.
-
#age ⇒ Integer
The age of a file (in days).
-
#created_before ⇒ String, ...
A date in RFC 3339 format with only the date part (for instance, "2013-01-15").
-
#custom_time_before ⇒ String, ...
A date in RFC 3339 format with only the date part (for instance, "2013-01-15").
-
#days_since_custom_time ⇒ Integer?
Represents the number of days elapsed since the user-specified timestamp set on an object.
-
#days_since_noncurrent_time ⇒ Integer
Represents the number of days elapsed since the noncurrent timestamp of an object.
-
#is_live ⇒ Boolean
Relevant only for versioned files.
-
#matches_storage_class ⇒ Array<String>
Files having any of the storage classes specified by this condition will be matched.
-
#noncurrent_time_before ⇒ String, ...
A date in RFC 3339 format with only the date part (for instance, "2013-01-15").
-
#num_newer_versions ⇒ Integer
Relevant only for versioned files.
-
#storage_class ⇒ String
The target storage class for the action.
Instance Attribute Details
#action ⇒ String
The type of action taken when the rule's
conditions are met. Currently, only Delete
and SetStorageClass
are supported.
373 374 375 |
# File 'lib/google/cloud/storage/bucket/lifecycle.rb', line 373 def action @action end |
#age ⇒ Integer
The age of a file (in days). This condition is satisfied when a file reaches the specified age.
373 374 375 |
# File 'lib/google/cloud/storage/bucket/lifecycle.rb', line 373 def age @age end |
#created_before ⇒ String, ...
A date in RFC 3339 format with only the date part (for instance, "2013-01-15"). This condition is satisfied when a file is created before midnight of the specified date in UTC. When returned by the service, a non-empty value will always be a Date object.
373 374 375 |
# File 'lib/google/cloud/storage/bucket/lifecycle.rb', line 373 def created_before @created_before end |
#custom_time_before ⇒ String, ...
A date in RFC 3339 format with only the date part (for instance, "2013-01-15"). This condition is satisfied when the custom time on an object is before this date in UTC.
373 374 375 |
# File 'lib/google/cloud/storage/bucket/lifecycle.rb', line 373 def custom_time_before @custom_time_before end |
#days_since_custom_time ⇒ Integer?
Represents the number of days elapsed since the user-specified timestamp set on an object. The condition is satisfied if the days elapsed is at least this number. If no custom timestamp is specified on an object, the condition does not apply.
373 374 375 |
# File 'lib/google/cloud/storage/bucket/lifecycle.rb', line 373 def days_since_custom_time @days_since_custom_time end |
#days_since_noncurrent_time ⇒ Integer
Represents the number of days elapsed since the noncurrent timestamp of an object. The condition is satisfied if the days elapsed is at least this number. The value of the field must be a nonnegative integer. If it's zero, the object version will become eligible for Lifecycle action as soon as it becomes noncurrent. Relevant only for versioning-enabled buckets. (See Google::Cloud::Storage::Bucket#versioning?)
373 374 375 |
# File 'lib/google/cloud/storage/bucket/lifecycle.rb', line 373 def days_since_noncurrent_time @days_since_noncurrent_time end |
#is_live ⇒ Boolean
Relevant only for versioned files. If the
value is true
, this condition matches live files; if the value
is false
, it matches archived files.
373 374 375 |
# File 'lib/google/cloud/storage/bucket/lifecycle.rb', line 373 def is_live @is_live end |
#matches_storage_class ⇒ Array<String>
Files having any of the
storage classes specified by this condition will be matched.
Values include STANDARD
, NEARLINE
, COLDLINE
, and ARCHIVE
.
REGIONAL
, MULTI_REGIONAL
, and DURABLE_REDUCED_AVAILABILITY
are supported as legacy storage classes.
373 374 375 |
# File 'lib/google/cloud/storage/bucket/lifecycle.rb', line 373 def matches_storage_class @matches_storage_class end |
#noncurrent_time_before ⇒ String, ...
A date in RFC 3339 format with only the date part (for instance, "2013-01-15"). This condition is satisfied when the noncurrent time on an object is before this date in UTC. This condition is relevant only for versioned objects. When returned by the service, a non-empty value will always be a Date object.
373 374 375 |
# File 'lib/google/cloud/storage/bucket/lifecycle.rb', line 373 def noncurrent_time_before @noncurrent_time_before end |
#num_newer_versions ⇒ Integer
Relevant only for versioned files. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the file.
373 374 375 |
# File 'lib/google/cloud/storage/bucket/lifecycle.rb', line 373 def num_newer_versions @num_newer_versions end |
#storage_class ⇒ String
The target storage class for the
action. Required only if the action is SetStorageClass
.
373 374 375 |
# File 'lib/google/cloud/storage/bucket/lifecycle.rb', line 373 def storage_class @storage_class end |