2011-11-27 15:01:56 -05:00
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Clodo
|
|
|
|
class Real
|
|
|
|
|
|
|
|
# Move IP-address to specified server.
|
|
|
|
# ==== Paramaters
|
|
|
|
# * server_id<~Integer> - Id of server to move IP to
|
|
|
|
# * ip<~String> - IP-address to move
|
|
|
|
#
|
|
|
|
# ==== Returns
|
|
|
|
# * response<~Excon::Response>
|
|
|
|
#
|
|
|
|
|
2011-11-27 15:03:52 -05:00
|
|
|
def move_ip_address(server_id, ip)
|
2011-11-27 15:01:56 -05:00
|
|
|
request(
|
2011-11-28 10:55:03 -05:00
|
|
|
:expects => [204],
|
2011-11-27 15:01:56 -05:00
|
|
|
:method => 'GET',
|
2011-11-28 10:55:03 -05:00
|
|
|
:path => "servers/#{server_id}/ips/moveip",
|
2012-04-25 10:31:28 -04:00
|
|
|
:body => Fog::JSON.encode({'ip'=>"#{ip}"})
|
2011-11-27 15:01:56 -05:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Mock
|
2011-11-27 15:03:52 -05:00
|
|
|
def move_ip_address(server_id, ip)
|
2011-11-27 15:01:56 -05:00
|
|
|
response = Excon::Response.new
|
2011-11-27 15:03:52 -05:00
|
|
|
response.status = [204]
|
2011-11-27 15:01:56 -05:00
|
|
|
response
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|