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

Added ip_address methods consistent with openstack

This commit is contained in:
Marcus Nilsson 2014-05-14 22:02:37 +02:00
parent 5aa2261416
commit ff70ff2b1b

View file

@ -49,6 +49,22 @@ module Fog
nics.map{|nic| Address.new(nic)}
end
def ip_addresses
addresses.map{|a| a.ip_address}
end
def public_ip_addresses
if public_ip_address.nil? then [public_ip_address] else [] end
end
def private_ip_addresses
ip_addresses - public_ip_addresses
end
def private_ip_address
private_ip_addresses.first
end
def destroy(options={})
requires :id
data = service.destroy_virtual_machine(options.merge({'id'=> self.id}))