Add an ip-adress to the server.
# File lib/fog/glesys/models/compute/ip.rb, line 40 def attach(server) requires :ip server = server.serverid if server.is_a?(Fog::Compute::Glesys::Server) raise Fog::Errors::Error.new("Ip is already attached to a server, #{serverid}") unless serverid.nil? data = service.ip_add( :ipaddress => identity, :serverid => server ).body["response"]["details"] merge_attributes data end
# File lib/fog/glesys/models/compute/ip.rb, line 26 def attached? !serverid.nil? end
Remove the ip from a server and release it
# File lib/fog/glesys/models/compute/ip.rb, line 60 def destroy requires :ip remove(:release => true) end
Return an unused ip-address to the pool of free ips.
# File lib/fog/glesys/models/compute/ip.rb, line 31 def release requires :ip raise Fog::Errors::Error.new('You can\t release a ip that is attached to a server') if attached? service.ip_release( :ipaddress => identity ) end
Remove an ip from the server
# File lib/fog/glesys/models/compute/ip.rb, line 52 def remove(options = {}) requires :ip raise Fog::Errors::Error.new('Ip is not attached to a server.') if serverid.nil? data = service.ip_remove({:ipaddress => ip}.merge!(options)).body["response"]["details"] merge_attributes data end
Generated with the Darkfish Rdoc Generator 2.