Sha256: 3efd804e555abe5a698ae7334c6eaecf95c214f195da93ade0ffda3c754dc24d

Contents?: true

Size: 721 Bytes

Versions: 12

Compression:

Stored size: 721 Bytes

Contents

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

module Fog
  module Compute
    class OpenNebula

      class Flavors < Fog::Collection

        model Fog::Compute::OpenNebula::Flavor

        def all
          data = service.template_pool
          load(data)
        end

        def get(flavor_id)
          data = service.template_pool({:id => flavor_id})
          load(data).first
        rescue Fog::Compute::OpenNebula::NotFound
          nil
        end

        def get_by_name(flavor_name)
          data = service.template_pool({:name => flavor_name})
          load(data)
        rescue Fog::Compute::OpenNebula::NotFound
          nil
        end

      end

    end
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
nsidc-fog-1.24.1 lib/fog/opennebula/models/compute/flavors.rb
fog-1.24.0 lib/fog/opennebula/models/compute/flavors.rb
ns-fog-1.22.11 lib/fog/opennebula/models/compute/flavors.rb
ns-fog-1.22.10 lib/fog/opennebula/models/compute/flavors.rb
ns-fog-1.22.9 lib/fog/opennebula/models/compute/flavors.rb
ns-fog-1.22.8 lib/fog/opennebula/models/compute/flavors.rb
ns-fog-1.22.7 lib/fog/opennebula/models/compute/flavors.rb
ns-fog-1.22.6 lib/fog/opennebula/models/compute/flavors.rb
fog-1.23.0 lib/fog/opennebula/models/compute/flavors.rb
ns-fog-1.22.4 lib/fog/opennebula/models/compute/flavors.rb
ns-fog-1.22.3 lib/fog/opennebula/models/compute/flavors.rb
ns-fog-1.22.2 lib/fog/opennebula/models/compute/flavors.rb