Sha256: 7476898d3d3e5eb83bd414546b99d05e84e1df7fd27f4a94dbb92f131d28c4b2

Contents?: true

Size: 914 Bytes

Versions: 29

Compression:

Stored size: 914 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

        def get_by_filter(flavor_filter)
          data = service.template_pool(flavor_filter)
          load(data)
        rescue Fog::Compute::OpenNebula::NotFound
          nil
        end

      end

    end
  end
end

Version data entries

29 entries across 27 versions & 4 rubygems

Version Path
fog-2.3.0 lib/fog/opennebula/models/compute/flavors.rb
fog-ifeel-2.2.0 lib/fog/opennebula/models/compute/flavors.rb
fog-2.2.0 lib/fog/opennebula/models/compute/flavors.rb
fog-2.1.0 lib/fog/opennebula/models/compute/flavors.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/opennebula/models/compute/flavors.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/opennebula/models/compute/flavors.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/opennebula/models/compute/flavors.rb
fog-1.42.1 lib/fog/opennebula/models/compute/flavors.rb
fog-2.0.0 lib/fog/opennebula/models/compute/flavors.rb
fog-1.42.0 lib/fog/opennebula/models/compute/flavors.rb
fog-1.41.0 lib/fog/opennebula/models/compute/flavors.rb
fog-1.40.0 lib/fog/opennebula/models/compute/flavors.rb
fog-1.39.0 lib/fog/opennebula/models/compute/flavors.rb
fog-1.38.0 lib/fog/opennebula/models/compute/flavors.rb
fog-1.37.0 lib/fog/opennebula/models/compute/flavors.rb
fog-1.36.0 lib/fog/opennebula/models/compute/flavors.rb
fog-1.35.0 lib/fog/opennebula/models/compute/flavors.rb
fog-2.0.0.pre.0 lib/fog/opennebula/models/compute/flavors.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/opennebula/models/compute/flavors.rb
fog-1.34.0 lib/fog/opennebula/models/compute/flavors.rb