2012-10-22 17:15:33 -07:00
|
|
|
require 'fog/core/collection'
|
2012-12-04 12:01:36 -08:00
|
|
|
require 'fog/google/models/compute/image'
|
2012-10-22 17:15:33 -07:00
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
2012-12-04 12:05:11 -08:00
|
|
|
class Google
|
2012-10-22 17:15:33 -07:00
|
|
|
|
|
|
|
class Images < Fog::Collection
|
|
|
|
|
2012-12-04 12:05:11 -08:00
|
|
|
model Fog::Compute::Google::Image
|
2012-10-22 17:15:33 -07:00
|
|
|
|
|
|
|
def all
|
|
|
|
data = connection.list_images.body["items"]
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(identity)
|
|
|
|
data = connection.get_image(identity).body
|
|
|
|
new(data)
|
|
|
|
rescue Excon::Errors::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|