Class: Google::Cloud::Storage::Bucket::Lifecycle
- Inherits:
-
Array
- Object
- Array
- Google::Cloud::Storage::Bucket::Lifecycle
- Defined in:
- lib/google/cloud/storage/bucket/lifecycle.rb
Overview
Bucket Lifecycle
A special-case Array for managing the Object Lifecycle Management rules for a bucket. Accessed via #lifecycle.
Defined Under Namespace
Classes: Rule
Instance Method Summary collapse
-
#add_delete_rule(age: nil, created_before: nil, custom_time_before: nil, days_since_custom_time: nil, days_since_noncurrent_time: nil, is_live: nil, matches_storage_class: nil, noncurrent_time_before: nil, num_newer_versions: nil) ⇒ Object
Adds a SetStorageClass lifecycle rule to the Object Lifecycle Management rules for a bucket.
-
#add_set_storage_class_rule(storage_class, age: nil, created_before: nil, custom_time_before: nil, days_since_custom_time: nil, days_since_noncurrent_time: nil, is_live: nil, matches_storage_class: nil, noncurrent_time_before: nil, num_newer_versions: nil) ⇒ Object
Adds a SetStorageClass lifecycle rule to the Object Lifecycle Management rules for a bucket.
Instance Method Details
#add_delete_rule(age: nil, created_before: nil, custom_time_before: nil, days_since_custom_time: nil, days_since_noncurrent_time: nil, is_live: nil, matches_storage_class: nil, noncurrent_time_before: nil, num_newer_versions: nil) ⇒ Object
Adds a SetStorageClass lifecycle rule to the Object Lifecycle Management rules for a bucket.
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/google/cloud/storage/bucket/lifecycle.rb', line 234 def add_delete_rule age: nil, created_before: nil, custom_time_before: nil, days_since_custom_time: nil, days_since_noncurrent_time: nil, is_live: nil, matches_storage_class: nil, noncurrent_time_before: nil, num_newer_versions: nil push Rule.new( "Delete", age: age, created_before: created_before, custom_time_before: custom_time_before, days_since_custom_time: days_since_custom_time, days_since_noncurrent_time: days_since_noncurrent_time, is_live: is_live, matches_storage_class: storage_class_for(matches_storage_class), noncurrent_time_before: noncurrent_time_before, num_newer_versions: num_newer_versions ) end |
#add_set_storage_class_rule(storage_class, age: nil, created_before: nil, custom_time_before: nil, days_since_custom_time: nil, days_since_noncurrent_time: nil, is_live: nil, matches_storage_class: nil, noncurrent_time_before: nil, num_newer_versions: nil) ⇒ Object
Adds a SetStorageClass lifecycle rule to the Object Lifecycle Management rules for a bucket.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/google/cloud/storage/bucket/lifecycle.rb', line 151 def add_set_storage_class_rule storage_class, age: nil, created_before: nil, custom_time_before: nil, days_since_custom_time: nil, days_since_noncurrent_time: nil, is_live: nil, matches_storage_class: nil, noncurrent_time_before: nil, num_newer_versions: nil push Rule.new( "SetStorageClass", storage_class: storage_class_for(storage_class), age: age, created_before: created_before, custom_time_before: custom_time_before, days_since_custom_time: days_since_custom_time, days_since_noncurrent_time: days_since_noncurrent_time, is_live: is_live, matches_storage_class: storage_class_for(matches_storage_class), noncurrent_time_before: noncurrent_time_before, num_newer_versions: num_newer_versions ) end |