1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Enable and add implementation for release address for request layer for the compute service.

This commit is contained in:
Rupak Ganguly 2011-12-06 15:47:11 -05:00
parent eb1470121e
commit f5cd3e3618
2 changed files with 40 additions and 0 deletions

View file

@ -51,6 +51,7 @@ module Fog
request :list_servers_detail
request :reboot_server
request :rebuild_server
request :release_address
#request :resize_server
#request :revert_resized_server
request :server_action

View file

@ -0,0 +1,39 @@
module Fog
module Compute
class HP
class Real
# Release an existing floating IP address
#
# ==== Parameters
# * id<~Integer> - Id of floating IP address to delete
#
def release_address(address_id)
request(
:expects => 202,
:method => 'DELETE',
:path => "os-floating-ips/#{address_id}"
)
end
end
class Mock
def release_address(address_id)
response = Excon::Response.new
if self.data[:addresses][address_id]
self.data[:last_modified][:addresses].delete(address_id)
self.data[:addresses].delete(address_id)
response.status = 202
response.body = "202 Accepted\n\nThe request is accepted for processing.\n\n "
response
else
raise Fog::Compute::HP::NotFound
end
end
end
end
end
end