2011-05-11 22:47:30 -04:00
|
|
|
require 'fog/core/collection'
|
2011-08-24 21:19:14 -04:00
|
|
|
require 'fog/ninefold/models/compute/address'
|
2011-05-11 22:47:30 -04:00
|
|
|
|
|
|
|
module Fog
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
|
|
|
class Ninefold
|
2011-05-11 22:47:30 -04:00
|
|
|
|
|
|
|
class Addresses < Fog::Collection
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
model Fog::Compute::Ninefold::Address
|
2011-05-11 22:47:30 -04:00
|
|
|
|
|
|
|
def all
|
|
|
|
data = connection.list_public_ip_addresses
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(identifier)
|
|
|
|
return nil if identifier.nil? || identifier == ""
|
|
|
|
data = connection.list_public_ip_addresses(:id => identifier)
|
|
|
|
if data.empty?
|
|
|
|
nil
|
|
|
|
else
|
|
|
|
new(data[0])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|