2010-05-11 20:39:07 -04:00
|
|
|
module Fog
|
|
|
|
module Parsers
|
2011-06-15 17:26:43 -04:00
|
|
|
module Storage
|
|
|
|
module AWS
|
2010-05-11 20:39:07 -04:00
|
|
|
|
2010-10-12 19:22:12 -04:00
|
|
|
class GetBucketLogging < Fog::Parsers::Base
|
2010-05-11 20:39:07 -04:00
|
|
|
|
|
|
|
def reset
|
|
|
|
@grant = { 'Grantee' => {} }
|
|
|
|
@response = { 'BucketLoggingStatus' => {} }
|
|
|
|
end
|
|
|
|
|
|
|
|
def end_element(name)
|
|
|
|
case name
|
|
|
|
when 'DisplayName', 'ID'
|
|
|
|
if @in_access_control_list
|
2011-05-12 16:15:13 -04:00
|
|
|
@grant['Grantee'][name] = value
|
2010-05-11 20:39:07 -04:00
|
|
|
else
|
2011-05-12 16:15:13 -04:00
|
|
|
@response['Owner'][name] = value
|
2010-05-11 20:39:07 -04:00
|
|
|
end
|
|
|
|
when 'Grant'
|
|
|
|
@response['BucketLoggingStatus']['LoggingEnabled']['TargetGrants'] << @grant
|
|
|
|
@grant = { 'Grantee' => {} }
|
|
|
|
when 'LoggingEnabled'
|
|
|
|
@response['BucketLoggingStatus']['LoggingEnabled'] = { 'TargetGrants' => [] }
|
|
|
|
when 'Permission'
|
2011-05-12 16:15:13 -04:00
|
|
|
@grant[name] = value
|
2010-05-11 20:39:07 -04:00
|
|
|
when 'TargetBucket', 'TargetPrefix'
|
2011-05-12 16:15:13 -04:00
|
|
|
@response['BucketLoggingStatus'][name] = value
|
2010-05-11 20:39:07 -04:00
|
|
|
when 'URI'
|
2011-05-12 16:15:13 -04:00
|
|
|
@grant['Grantee'][name] = value
|
2010-05-11 20:39:07 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|