2010-10-04 14:02:08 -07:00
|
|
|
require 'fog/core/collection'
|
2011-01-14 10:41:12 -08:00
|
|
|
require 'fog/compute/models/slicehost/image'
|
2010-09-08 15:00:47 -07:00
|
|
|
|
|
|
|
module Fog
|
2011-06-16 16:28:54 -07:00
|
|
|
module Compute
|
|
|
|
class Slicehost
|
2010-09-08 15:00:47 -07:00
|
|
|
|
|
|
|
class Images < Fog::Collection
|
|
|
|
|
2011-06-16 16:28:54 -07:00
|
|
|
model Fog::Compute::Slicehost::Image
|
2010-09-08 15:00:47 -07:00
|
|
|
|
|
|
|
def all
|
|
|
|
data = connection.get_images.body['images']
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(image_id)
|
|
|
|
connection.get_image(image_id)
|
|
|
|
rescue Excon::Errors::Forbidden
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|