Sha256: 4618cd832043b7c7af12e50e428bb76268ef87ebc94fbbf8c0f26d952ee1f4d7

Contents?: true

Size: 515 Bytes

Versions: 11

Compression:

Stored size: 515 Bytes

Contents

require 'fog/core/collection'
require 'fog/google/models/compute/flavor'

module Fog
  module Compute
    class Google

      class Flavors < Fog::Collection

        model Fog::Compute::Google::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

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
gapinc-fog-1.12.1.2.1 lib/fog/google/models/compute/flavors.rb
fog-1.14.0 lib/fog/google/models/compute/flavors.rb
fog-1.13.0 lib/fog/google/models/compute/flavors.rb
gapinc-fog-1.12.1.2 lib/fog/google/models/compute/flavors.rb
gapinc-fog-1.12.1.1 lib/fog/google/models/compute/flavors.rb
gapinc-fog-1.12.1a lib/fog/google/models/compute/flavors.rb
gapinc-fog-1.12.1 lib/fog/google/models/compute/flavors.rb
fog-1.12.1 lib/fog/google/models/compute/flavors.rb
fog-1.12.0 lib/fog/google/models/compute/flavors.rb
fog-1.11.1 lib/fog/google/models/compute/flavors.rb
fog-1.11.0 lib/fog/google/models/compute/flavors.rb