Class: AliyunSDK::OSS::LifeCycleRule

Inherits:
Common::Struct::Base show all
Defined in:
lib/aliyun_sdk/oss/struct.rb

Overview

Note:

the expiry date is treated as UTC time

LifeCycle rule for bucket. See: OSS Bucket LifeCycle Attributes:

  • id [String] the unique id of a rule

  • enabled [Boolean] whether to enable this rule

  • prefix [String] the prefix objects to apply this rule

  • expiry [Date] or [Fixnum] the expire time of objects

    • if expiry is a Date, it specifies the absolute date to expire objects

    • if expiry is a Fixnum, it specifies the relative date to expire objects: how many days after the object’s last modification time to expire the object

Examples:

Specify expiry as Date

LifeCycleRule.new(
  :id => 'rule1',
  :enabled => true,
  :prefix => 'foo/',
  :expiry => Date.new(2016, 1, 1))

Specify expiry as days

LifeCycleRule.new(
  :id => 'rule1',
  :enabled => true,
  :prefix => 'foo/',
  :expiry => 15)

Instance Method Summary collapse

Methods inherited from Common::Struct::Base

#initialize, #to_s

Methods included from Common::Struct::Base::AttrHelper

#attrs

Constructor Details

This class inherits a constructor from AliyunSDK::Common::Struct::Base

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


133
134
135
# File 'lib/aliyun_sdk/oss/struct.rb', line 133

def enabled?
  enable == true
end