ruby/example_code/s3/s3-ruby-example-access-permissions.rb
# Prints information about the Amazon S3 bucket at the given path.
#
# Prerequisites:
#
# - An Amazon S3 bucket.
#
# @param bucket_name [String] The bucket's name.
# @param region [String] The AWS Region for the bucket.
# @example
#   object_content_by_bucket_unsigned_request(
#     'doc-example-bucket',
#     'us-west-2'
#   )

Prints information about the Amazon S3 bucket at the given path.
Prerequisites.

An Amazon S3 bucket.
Prints information about the Amazon S3 bucket at the given path . Prerequisites . An Amazon S3 bucket .
def object_content_by_bucket_unsigned_request(bucket_name, region)
  bucket_path = "https://s3.#{region}.amazonaws.com/#{bucket_name}"
  response = Net::HTTP.get(URI(bucket_path))
  puts "Content of unsigned request to '#{bucket_path}':\n\n#{response}\n\n"
end
def object_content_by_bucket_unsigned_request ( bucket_name , region ) bucket_path = "https://s3.#{region}.amazonaws.com/#{bucket_name}" response = Net :: HTTP . get ( URI ( bucket_path ) ) puts "Content of unsigned request to '#{bucket_path}':\n\n#{response}\n\n" end
Prints information about the Amazon S3 bucket at the given path.
Prints information about the Amazon S3 bucket at the given path .
bucket_name
The bucket's name.
The bucket ' s name .
region
The AWS Region for the bucket.
The AWS Region for the bucket .
example
object_content_by_bucket_unsigned_request( 'doc-example-bucket', 'us-west-2' )
object_content_by_bucket_unsigned_request ( ' doc - example - bucket ' ' us - west - 2 ' )