2010-05-11 20:39:07 -04:00
|
|
|
module Fog
|
2011-06-15 17:26:43 -04:00
|
|
|
module Storage
|
|
|
|
class AWS
|
2010-05-11 20:39:07 -04:00
|
|
|
class Real
|
|
|
|
|
2011-08-24 14:50:42 -04:00
|
|
|
require 'fog/aws/parsers/storage/get_bucket_logging'
|
2010-06-12 18:31:17 -04:00
|
|
|
|
2010-05-11 20:39:07 -04:00
|
|
|
# Get logging status for an S3 bucket
|
|
|
|
#
|
2013-01-04 00:56:21 -05:00
|
|
|
# @param bucket_name [String] name of bucket to get logging status for
|
2010-05-11 20:39:07 -04:00
|
|
|
#
|
2013-01-04 00:56:21 -05:00
|
|
|
# @return [Excon::Response] response:
|
|
|
|
# * body [Hash]:
|
|
|
|
# * BucketLoggingStatus (will be empty if logging is disabled) [Hash]:
|
|
|
|
# * LoggingEnabled [Hash]:
|
|
|
|
# * TargetBucket [String] - bucket where logs are stored
|
|
|
|
# * TargetPrefix [String] - prefix logs are stored with
|
|
|
|
# * TargetGrants [Array]:
|
|
|
|
# * Grant [Hash]:
|
|
|
|
# * Grantee [Hash]:
|
|
|
|
# * DisplayName [String] - Display name of grantee
|
|
|
|
# * ID [String] - Id of grantee
|
2010-05-11 20:39:07 -04:00
|
|
|
# or
|
2013-01-04 00:56:21 -05:00
|
|
|
# * URI [String] - URI of group to grant access for
|
|
|
|
# * Permission [String] - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
|
2010-05-11 20:39:07 -04:00
|
|
|
#
|
2013-01-04 00:56:21 -05:00
|
|
|
# @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETlogging.html
|
2010-10-29 21:05:59 -04:00
|
|
|
|
2010-05-11 20:39:07 -04:00
|
|
|
def get_bucket_logging(bucket_name)
|
|
|
|
unless bucket_name
|
|
|
|
raise ArgumentError.new('bucket_name is required')
|
|
|
|
end
|
|
|
|
request({
|
|
|
|
:expects => 200,
|
|
|
|
:headers => {},
|
2013-04-12 06:31:10 -04:00
|
|
|
:bucket_name => bucket_name,
|
2010-05-11 20:39:07 -04:00
|
|
|
:idempotent => true,
|
|
|
|
:method => 'GET',
|
2011-06-15 17:26:43 -04:00
|
|
|
:parser => Fog::Parsers::Storage::AWS::GetBucketLogging.new,
|
2010-06-05 17:19:39 -04:00
|
|
|
:query => {'logging' => nil}
|
2010-05-11 20:39:07 -04:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|