2012-02-16 02:46:13 -05:00
|
|
|
module Fog
|
|
|
|
module Compute
|
2012-02-21 11:09:26 -05:00
|
|
|
class OpenStack
|
2012-02-16 02:46:13 -05:00
|
|
|
class Real
|
|
|
|
|
|
|
|
def disassociate_address(server_id, ip_address)
|
|
|
|
|
|
|
|
body = { 'removeFloatingIp' => { 'server' => server_id, 'address' => ip_address }}
|
2012-02-21 11:09:26 -05:00
|
|
|
|
2012-02-16 02:46:13 -05:00
|
|
|
request(
|
|
|
|
:body => MultiJson.encode(body),
|
|
|
|
:expects => 202,
|
|
|
|
:method => 'POST',
|
|
|
|
:path => "servers/#{server_id}/action.json"
|
|
|
|
)
|
2012-02-21 11:09:26 -05:00
|
|
|
|
|
|
|
|
2012-02-16 02:46:13 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
class Mock
|
2012-02-24 06:24:00 -05:00
|
|
|
def disassociate_address(server_id, ip_address)
|
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = 202
|
|
|
|
response.headers = {
|
|
|
|
"Content-Type" => "text/html, charset=UTF-8",
|
|
|
|
"Content-Length" => "0",
|
|
|
|
"Date"=> Date.new
|
|
|
|
}
|
|
|
|
response
|
|
|
|
end
|
2012-02-16 02:46:13 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|