2010-11-08 07:21:31 -05:00
|
|
|
require 'fog/core/collection'
|
2011-08-24 21:31:12 -04:00
|
|
|
require 'fog/brightbox/models/compute/image'
|
2010-11-08 07:21:31 -05:00
|
|
|
|
|
|
|
module Fog
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
|
|
|
class Brightbox
|
2010-11-08 07:21:31 -05:00
|
|
|
|
|
|
|
class Images < Fog::Collection
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
model Fog::Compute::Brightbox::Image
|
2010-11-08 07:21:31 -05:00
|
|
|
|
|
|
|
def all
|
2010-11-09 12:40:04 -05:00
|
|
|
data = connection.list_images
|
|
|
|
load(data)
|
2010-11-08 07:21:31 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def get(identifier)
|
2010-11-09 12:40:04 -05:00
|
|
|
data = connection.get_image(identifier)
|
|
|
|
new(data)
|
2010-11-08 07:21:31 -05:00
|
|
|
rescue Excon::Errors::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|