2011-05-11 21:35:02 -04:00
|
|
|
require 'fog/core/collection'
|
2011-08-24 21:19:14 -04:00
|
|
|
require 'fog/ninefold/models/compute/image'
|
2011-05-11 21:35:02 -04:00
|
|
|
|
|
|
|
module Fog
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
|
|
|
class Ninefold
|
2011-05-11 21:35:02 -04:00
|
|
|
|
|
|
|
class Images < Fog::Collection
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
model Fog::Compute::Ninefold::Image
|
2011-05-11 21:35:02 -04:00
|
|
|
|
|
|
|
def all(offering = 'executable')
|
2012-12-22 18:24:54 -05:00
|
|
|
data = service.list_templates(:templatefilter => offering)
|
2011-05-11 21:35:02 -04:00
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(identifier, offering = 'executable')
|
2012-12-22 18:24:54 -05:00
|
|
|
data = service.list_templates(:templatefilter => offering, :id => identifier)
|
2011-05-11 21:35:02 -04:00
|
|
|
if data.empty?
|
|
|
|
nil
|
|
|
|
else
|
|
|
|
new(data[0])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|