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

Class: Aws::S3::BucketVersioning

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)

#mfa_deleteString (readonly)

Specifies whether MFA delete is enabled in the bucket versioning configuration. This element is only returned if the bucket has been configured with MFA delete. If the bucket has never been so configured, this element is not returned.

Possible values:

  • Enabled
  • Disabled

Returns:

  • (String)

    Specifies whether MFA delete is enabled in the bucket versioning configuration.

#statusString (readonly)

The versioning state of the bucket.

Possible values:

  • Enabled
  • Suspended

Returns:

  • (String)

    The versioning state of the bucket.

Instance Method Details

#bucketBucket

Returns:

#enable(options = {}) ⇒ Struct

Sets the versioning state of an existing bucket. To set the versioning state, you must be the bucket owner.

Examples:

Request syntax example with placeholder values


bucketversioning.enable({
  content_md5: "ContentMD5",
  mfa: "MFA",
  use_accelerate_endpoint: false,
})

Options Hash (options):

  • :content_md5 (String)
  • :mfa (String)

    The concatenation of the authentication device\'s serial number, a space, and the value that is displayed on your authentication device.

  • :use_accelerate_endpoint (Boolean)

    When true, the "https://BUCKETNAME.s3-accelerate.amazonaws.com" endpoint will be used.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#put(options = {}) ⇒ Struct

Sets the versioning state of an existing bucket. To set the versioning state, you must be the bucket owner.

Examples:

Request syntax example with placeholder values


bucketversioning.put({
  content_md5: "ContentMD5",
  mfa: "MFA",
  versioning_configuration: { # required
    mfa_delete: "Enabled", # accepts Enabled, Disabled
    status: "Enabled", # accepts Enabled, Suspended
  },
  use_accelerate_endpoint: false,
})

Options Hash (options):

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#suspend(options = {}) ⇒ Struct

Sets the versioning state of an existing bucket. To set the versioning state, you must be the bucket owner.

Examples:

Request syntax example with placeholder values


bucketversioning.suspend({
  content_md5: "ContentMD5",
  mfa: "MFA",
  use_accelerate_endpoint: false,
})

Options Hash (options):

  • :content_md5 (String)
  • :mfa (String)

    The concatenation of the authentication device\'s serial number, a space, and the value that is displayed on your authentication device.

  • :use_accelerate_endpoint (Boolean)

    When true, the "https://BUCKETNAME.s3-accelerate.amazonaws.com" endpoint will be used.

Returns:

  • (Struct)

    Returns an empty response.

See Also: