You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::S3::BucketLifecycle

Inherits:
Resources::Resource show all
Defined in:
(unknown)

Instance Attribute Summary collapse

Attributes inherited from Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

#initialize(bucket_name, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

  • #initialize(bucket_name, options = {}) ⇒ Object

    Parameters:

    • bucket_name (String)

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :bucket_name (required, String)
    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Attribute Details

#bucket_nameString (readonly)

Returns:

  • (String)

#rulesArray<Types::Rule> (readonly)

Returns:

Instance Method Details

#bucketBucket

Returns:

#delete(options = {}) ⇒ Struct

Deletes the lifecycle configuration from the bucket.

Examples:

Request syntax example with placeholder values


bucketlifecycle.delete({
  use_accelerate_endpoint: false,
})

Options Hash (options):

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#put(options = {}) ⇒ Struct

Deprecated, see the PutBucketLifecycleConfiguration operation.

Examples:

Request syntax example with placeholder values


bucketlifecycle.put({
  content_md5: "ContentMD5",
  lifecycle_configuration: {
    rules: [ # required
      {
        expiration: {
          date: Time.now,
          days: 1,
          expired_object_delete_marker: false,
        },
        id: "ID",
        prefix: "Prefix", # required
        status: "Enabled", # required, accepts Enabled, Disabled
        transition: {
          date: Time.now,
          days: 1,
          storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA
        },
        noncurrent_version_transition: {
          noncurrent_days: 1,
          storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA
        },
        noncurrent_version_expiration: {
          noncurrent_days: 1,
        },
        abort_incomplete_multipart_upload: {
          days_after_initiation: 1,
        },
      },
    ],
  },
  use_accelerate_endpoint: false,
})

Options Hash (options):

Returns:

  • (Struct)

    Returns an empty response.

See Also: