Sha256: 07d58e35ab6f36c7373e22f049e7e859d3f040c3d16756e7d60dbafc83e8f0f1

Contents?: true

Size: 668 Bytes

Versions: 40

Compression:

Stored size: 668 Bytes

Contents

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

module Fog
  module Compute
    class Cloudstack
      class Flavors < Fog::Collection
        model Fog::Compute::Cloudstack::Flavor

        def all
          data = service.list_service_offerings["listserviceofferingsresponse"]["serviceoffering"] || []
          load(data)
        end

        def get(flavor_id)
          if flavor = service.list_service_offerings('id' => flavor_id)["listserviceofferingsresponse"]["serviceoffering"].first
            new(flavor)
          end
        rescue Fog::Compute::Cloudstack::BadRequest
          nil
        end
      end
    end
  end
end

Version data entries

40 entries across 38 versions & 5 rubygems

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