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:
parent
9462528dc9
commit
6bd3e79448
3 changed files with 58 additions and 0 deletions
28
lib/fog/aws/parsers/sqs/get_queue_attributes.rb
Normal file
28
lib/fog/aws/parsers/sqs/get_queue_attributes.rb
Normal 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
|
29
lib/fog/aws/requests/sqs/get_queue_attributes.rb
Normal file
29
lib/fog/aws/requests/sqs/get_queue_attributes.rb
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue