2011-08-24 20:29:14 -05:00
|
|
|
require 'fog/ecloud/models/compute/ip'
|
2011-02-17 10:44:46 -08:00
|
|
|
|
|
|
|
module Fog
|
2011-06-16 16:28:54 -07:00
|
|
|
module Compute
|
|
|
|
class Ecloud
|
2011-02-17 10:44:46 -08:00
|
|
|
class Ips < Fog::Ecloud::Collection
|
|
|
|
|
2011-06-16 16:28:54 -07:00
|
|
|
model Fog::Compute::Ecloud::Ip
|
2011-02-17 10:44:46 -08:00
|
|
|
|
|
|
|
undef_method :create
|
|
|
|
|
|
|
|
attribute :href
|
|
|
|
|
|
|
|
def all
|
|
|
|
check_href!( :messages => "Ips href of a Network you want to enumerate" )
|
|
|
|
if data = connection.get_network_ips(href).body[:IpAddress]
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(uri)
|
|
|
|
if data = connection.get_network_ip(uri).body
|
|
|
|
new(data)
|
|
|
|
end
|
|
|
|
rescue Fog::Errors::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|