2011-08-24 21:11:42 -04:00
|
|
|
require 'fog/vcloud/models/compute/ip'
|
2011-05-23 21:17:16 -04:00
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Vcloud
|
|
|
|
class Compute
|
|
|
|
class Ips < Fog::Vcloud::Collection
|
|
|
|
model Fog::Vcloud::Compute::Ip
|
|
|
|
|
|
|
|
undef_method :create
|
|
|
|
|
|
|
|
attribute :href
|
|
|
|
|
|
|
|
def all
|
2012-12-22 18:22:50 -05:00
|
|
|
self.href = service.default_vdc_href unless self.href
|
2011-05-23 21:17:16 -04:00
|
|
|
check_href!( :messages => "Ips href of a Network you want to enumerate" )
|
2012-12-22 18:22:50 -05:00
|
|
|
if data = service.get_network_ips(href).body[:IpAddress]
|
2011-05-23 21:17:16 -04:00
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(uri)
|
2012-12-22 18:22:50 -05:00
|
|
|
if data = service.get_network_ip(uri).body
|
2011-05-23 21:17:16 -04:00
|
|
|
new(data)
|
|
|
|
end
|
|
|
|
rescue Fog::Errors::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|