1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Add SQS get_queue_attributes

This commit is contained in:
Jon Crosby 2011-02-05 20:33:53 -08:00 committed by geemus
parent 9462528dc9
commit 6bd3e79448
3 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,28 @@
module Fog
module Parsers
module AWS
module SQS
class GetQueueAttributes < Fog::Parsers::Base
def reset
@response = { 'ResponseMetadata' => {}, 'Attributes' => {}}
end
def end_element(name)
case name
when 'RequestId'
@response['ResponseMetadata']['RequestId'] = @value
when 'Name'
@current_attribute_name = @value
when 'Value'
@response['Attributes'][@current_attribute_name] = @value
end
end
end
end
end
end
end

View file

@ -0,0 +1,29 @@
module Fog
module AWS
class SQS
class Real
require 'fog/aws/parsers/sqs/get_queue_attributes'
def get_queue_attributes(name)
request({
'Action' => 'GetQueueAttributes',
'AttributeName' => 'All',
:path => path_from_queue_name(name),
:parser => Fog::Parsers::AWS::SQS::GetQueueAttributes.new
})
end
end
class Mock
def get_queue_attributes(name)
Fog::Mock.not_implemented
end
end
end
end
end

View file

@ -9,6 +9,7 @@ module Fog
request :create_queue
request :delete_message
request :delete_queue
request :get_queue_attributes
request :list_queues
request :receive_message
request :send_message