1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00
fog--fog-aws/lib/fog/aws/requests/rds/delete_event_subscription.rb
Josh Lane d48d376e9c initial import
* take the liberty of correcting Aws naming
2014-12-31 09:17:51 -08:00

44 lines
1.3 KiB
Ruby

module Fog
module AWS
class RDS
class Real
require 'fog/aws/parsers/rds/delete_event_subscription'
# deletes an event subscription
# http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DeleteEventSubscription.html
# === Parameters
# * SubscriptionName <~String> - The name of the subscription to delete
# === Returns
# * response<~Excon::Response>:
# * body<~Hash>
def delete_event_subscription(name)
request({
'Action' => 'DeleteEventSubscription',
'SubscriptionName' => name,
:parser => Fog::Parsers::AWS::RDS::DeleteEventSubscription.new
})
end
end
class Mock
def delete_event_subscription(name)
response = Excon::Response.new
if data = self.data[:event_subscriptions][name]
data['Status'] = 'deleting'
self.data[:event_subscriptions][name] = data
response.status = 200
response.body = {
"ResponseMetadata"=>{ "RequestId"=> Fog::AWS::Mock.request_id },
}
response
else
raise Fog::AWS::RDS::NotFound.new("EventSubscriptionNotFound => #{name} not found")
end
end
end
end
end
end