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/delete_queue.rb

48 lines
1.2 KiB
Ruby
Raw Normal View History

module Fog
module AWS
class SQS
class Real
2011-07-19 16:10:26 -04:00
require 'fog/aws/parsers/sqs/basic'
2011-07-19 16:10:26 -04:00
# Delete a queue
#
# ==== Parameters
# * queue_url<~String> - Url of queue to delete
#
# ==== See Also
# http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QueryDeleteQueue.html
#
def delete_queue(queue_url)
request({
'Action' => 'DeleteQueue',
2011-07-19 16:10:26 -04:00
:parser => Fog::Parsers::AWS::SQS::Basic.new,
:path => path_from_queue_url(queue_url),
})
end
end
2014-02-19 07:30:59 -05:00
2011-09-18 16:00:58 -04:00
class Mock
def delete_queue(queue_url)
Excon::Response.new.tap do |response|
if (queue = data[:queues][queue_url])
response.status = 200
2014-02-19 07:30:59 -05:00
2011-09-18 16:00:58 -04:00
data[:queues].delete(queue_url)
2014-02-19 07:30:59 -05:00
2011-09-18 16:00:58 -04:00
response.body = {
'ResponseMetadata' => {
'RequestId' => Fog::AWS::Mock.request_id
}
}
else
response.status = 404
raise(Excon::Errors.status_error({:expects => 200}, response))
end
end
end
end
end
end
end