1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/aws/requests/sqs/get_queue_attributes.rb

32 lines
1.1 KiB
Ruby
Raw Normal View History

2011-02-05 23:33:53 -05:00
module Fog
module AWS
class SQS
class Real
require 'fog/aws/parsers/sqs/get_queue_attributes'
2011-07-19 16:10:26 -04:00
# Get attributes of a queue
#
# ==== Parameters
# * queue_url<~String> - Url of queue to get attributes for
2011-07-19 18:53:26 -04:00
# * attribute_name<~Array> - Name of attribute to return, in ['All', 'ApproximateNumberOfMessages', 'ApproximateNumberOfMessagesNotVisible', 'CreatedTimestamp', 'LastModifiedTimestamp', 'MaximumMessageSize', 'MessageRetentionPeriod', 'Policy', 'QueueArn', 'VisibilityTimeout']
2011-07-19 16:10:26 -04:00
#
# ==== See Also
# http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QueryGetQueueAttributes.html
#
2011-07-19 18:53:26 -04:00
def get_queue_attributes(queue_url, attribute_name)
2011-02-05 23:33:53 -05:00
request({
'Action' => 'GetQueueAttributes',
2011-07-19 18:53:26 -04:00
'AttributeName' => attribute_name,
2011-07-19 16:10:26 -04:00
:path => path_from_queue_url(queue_url),
2011-02-05 23:33:53 -05:00
:parser => Fog::Parsers::AWS::SQS::GetQueueAttributes.new
2011-07-19 18:53:26 -04:00
})
2011-02-05 23:33:53 -05:00
end
end
end
end
end