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/openstack/requests/network/delete_router.rb

31 lines
673 B
Ruby
Raw Normal View History

module Fog
module Network
class OpenStack
class Real
def delete_router(router_id)
request(
:expects => 204,
:method => 'DELETE',
:path => "routers/#{router_id}"
)
end
end
class Mock
def delete_router(router_id)
response = Excon::Response.new
if list_routers.body['routers'].map { |r| r['id'] }.include? router_id
self.data[:routers].delete(router_id)
response.status = 204
response
else
raise Fog::Network::OpenStack::NotFound
end
end
end
end
end
end