2011-01-19 15:47:35 -05:00
|
|
|
require 'fog/core/collection'
|
2011-08-24 21:04:55 -04:00
|
|
|
require 'fog/voxel/models/compute/image'
|
2011-01-19 15:47:35 -05:00
|
|
|
|
|
|
|
module Fog
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
|
|
|
class Voxel
|
2011-01-19 15:47:35 -05:00
|
|
|
|
|
|
|
class Images < Fog::Collection
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
model Fog::Compute::Voxel::Image
|
2011-01-19 15:47:35 -05:00
|
|
|
|
|
|
|
def all
|
2012-12-22 18:22:08 -05:00
|
|
|
data = service.images_list.body['images']
|
2011-01-19 15:47:35 -05:00
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(image_id)
|
2012-12-22 18:22:08 -05:00
|
|
|
data = service.images_list(image_id).body['images']
|
2011-01-19 15:47:35 -05:00
|
|
|
|
2011-02-23 18:00:56 -05:00
|
|
|
if data.empty?
|
|
|
|
nil
|
|
|
|
else
|
|
|
|
new(data.first)
|
|
|
|
end
|
2011-02-09 11:04:31 -05:00
|
|
|
end
|
2011-01-19 15:47:35 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|