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/flavors.rb
2013-01-16 17:55:36 -08:00

28 lines
509 B
Ruby

require 'fog/core/collection'
require 'fog/google/models/compute/flavor'
module Fog
module Compute
class GCE
class Flavors < Fog::Collection
model Fog::Compute::GCE::Flavor
def all
data = connection.list_machine_types.body["items"]
load(data)
end
def get(identity)
data = connection.get_machine_type(identity).body
new(data)
rescue Excon::Errors::NotFound
nil
end
end
end
end
end