Sha256: 7ec639e46a80c243d5ed6ab1eed8b51c8e597b095f7a0e4bcdc37b3d3c60f2bd
Contents?: true
Size: 1.1 KB
Versions: 37
Compression:
Stored size: 1.1 KB
Contents
module Fog module AWS class Storage class Real # Get headers for an S3 bucket, used to verify if it exists and if you have permission to access it # # @param bucket_name [String] Name of bucket to read from # # @return [Excon::Response] 200 response implies it exists, 404 does not exist, 403 no permissions # * body [String] Empty # * headers [Hash]: # * Content-Type [String] - MIME type of object # # @see http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketHEAD.html # def head_bucket(bucket_name) unless bucket_name raise ArgumentError.new('bucket_name is required') end request({ :expects => 200, :bucket_name => bucket_name, :idempotent => true, :method => 'HEAD', }) end end class Mock # :nodoc:all def head_bucket(bucket_name) response = get_bucket(bucket_name) response.body = nil response end end end end end
Version data entries
37 entries across 37 versions & 1 rubygems