Class: AWS::S3::BucketLifecycleConfiguration::Rule
- Inherits:
-
Object
- Object
- AWS::S3::BucketLifecycleConfiguration::Rule
- Defined in:
- lib/aws/s3/bucket_lifecycle_configuration.rb
Overview
Represents a single rule from an Amazon S3 bucket lifecycle configuration.
# delete all objects with the prefix 'temporary/' after 10 days
bucket.lifecycle_configuration.add_rule 'temporary/', 10
# remove the rule created above
bucket.lifecycle_configuration.remove_rule 'temporary/'
Instance Attribute Summary collapse
- #configuration ⇒ BucketLifecycleConfiguration readonly
- #expiration_time ⇒ Date, Integer (also: #expiration_days)
- #glacier_transition_time ⇒ Date, Integer
- #id ⇒ String readonly
- #prefix ⇒ String
-
#status ⇒ String
Returns the rule status, 'Enabled' or 'Disabled'.
Instance Method Summary collapse
Instance Attribute Details
#configuration ⇒ BucketLifecycleConfiguration (readonly)
355 356 357 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 355 def configuration @configuration end |
#expiration_time ⇒ Date, Integer Also known as: expiration_days
366 367 368 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 366 def expiration_time @expiration_time end |
#glacier_transition_time ⇒ Date, Integer
381 382 383 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 381 def glacier_transition_time @glacier_transition_time end |
#id ⇒ String (readonly)
358 359 360 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 358 def id @id end |
#prefix ⇒ String
361 362 363 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 361 def prefix @prefix end |
#status ⇒ String
Returns the rule status, 'Enabled' or 'Disabled'
389 390 391 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 389 def status @status end |
Instance Method Details
#disabled! ⇒ Object
403 404 405 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 403 def disabled! self.status = 'Disabled' end |
#disabled? ⇒ Boolean
399 400 401 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 399 def disabled? status == 'Disabled' end |
#enable! ⇒ Object
395 396 397 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 395 def enable! self.status = 'Enabled' end |
#enabled? ⇒ Boolean
391 392 393 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 391 def enabled? status == 'Enabled' end |