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

Class: Aws::S3::BucketWebsite

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)

#error_documentTypes::ErrorDocument (readonly)

#index_documentTypes::IndexDocument (readonly)

#redirect_all_requests_toTypes::RedirectAllRequestsTo (readonly)

#routing_rulesArray<Types::RoutingRule> (readonly)

Returns:

Instance Method Details

#bucketBucket

Returns:

#delete(options = {}) ⇒ Struct

This operation removes the website configuration from the bucket.

Examples:

Request syntax example with placeholder values


bucketwebsite.delete({
  use_accelerate_endpoint: false,
})

Options Hash (options):

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#put(options = {}) ⇒ Struct

Set the website configuration for a bucket.

Examples:

Request syntax example with placeholder values


bucketwebsite.put({
  content_md5: "ContentMD5",
  website_configuration: { # required
    error_document: {
      key: "ObjectKey", # required
    },
    index_document: {
      suffix: "Suffix", # required
    },
    redirect_all_requests_to: {
      host_name: "HostName", # required
      protocol: "http", # accepts http, https
    },
    routing_rules: [
      {
        condition: {
          http_error_code_returned_equals: "HttpErrorCodeReturnedEquals",
          key_prefix_equals: "KeyPrefixEquals",
        },
        redirect: { # required
          host_name: "HostName",
          http_redirect_code: "HttpRedirectCode",
          protocol: "http", # accepts http, https
          replace_key_prefix_with: "ReplaceKeyPrefixWith",
          replace_key_with: "ReplaceKeyWith",
        },
      },
    ],
  },
  use_accelerate_endpoint: false,
})

Options Hash (options):

Returns:

  • (Struct)

    Returns an empty response.

See Also: