1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/google/models/compute/images.rb

29 lines
498 B
Ruby
Raw Normal View History

2012-10-22 20:15:33 -04:00
require 'fog/core/collection'
2012-12-04 15:01:36 -05:00
require 'fog/google/models/compute/image'
2012-10-22 20:15:33 -04:00
module Fog
module Compute
2012-12-04 15:05:11 -05:00
class Google
2012-10-22 20:15:33 -04:00
class Images < Fog::Collection
2012-12-04 15:05:11 -05:00
model Fog::Compute::Google::Image
2012-10-22 20:15:33 -04: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