2010-09-07 19:26:01 -04:00
|
|
|
require 'fog/collection'
|
2010-09-08 17:00:43 -04:00
|
|
|
require 'fog/bluebox/models/compute/image'
|
2010-09-07 19:26:01 -04:00
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Bluebox
|
2010-09-08 15:07:45 -04:00
|
|
|
class Compute
|
2010-09-07 19:26:01 -04:00
|
|
|
|
|
|
|
class Images < Fog::Collection
|
|
|
|
|
2010-09-08 17:00:43 -04:00
|
|
|
model Fog::Bluebox::Compute::Image
|
2010-09-07 19:26:01 -04:00
|
|
|
|
|
|
|
def all
|
|
|
|
data = connection.get_templates.body
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(template_id)
|
|
|
|
response = connection.get_template(template_id)
|
|
|
|
new(response.body)
|
2010-09-08 17:00:43 -04:00
|
|
|
rescue Fog::Bluebox::Compute::NotFound
|
2010-09-07 19:26:01 -04:00
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|