2011-06-28 17:30:31 -04:00
|
|
|
require 'fog/core/collection'
|
2011-10-17 15:25:07 -04:00
|
|
|
require 'fog/hp/models/compute/image'
|
2011-06-28 17:30:31 -04:00
|
|
|
|
|
|
|
module Fog
|
2011-10-17 15:25:07 -04:00
|
|
|
module Compute
|
|
|
|
class HP
|
2011-06-28 17:30:31 -04:00
|
|
|
|
|
|
|
class Images < Fog::Collection
|
|
|
|
|
2011-10-17 15:25:07 -04:00
|
|
|
model Fog::Compute::HP::Image
|
2011-06-28 17:30:31 -04:00
|
|
|
|
|
|
|
def all
|
|
|
|
data = connection.list_images_detail.body['images']
|
|
|
|
load(data)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(image_id)
|
|
|
|
data = connection.get_image_details(image_id).body['image']
|
|
|
|
new(data)
|
2011-10-17 15:25:07 -04:00
|
|
|
rescue Fog::Compute::HP::NotFound
|
2011-06-28 17:30:31 -04:00
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|