Sha256: 2586053d34ec7bbf4571266e510ed944a5948b870f3b55d8d5ea8be261b19cd1

Contents?: true

Size: 676 Bytes

Versions: 57

Compression:

Stored size: 676 Bytes

Contents

require 'fog/core/collection'
require 'fog/openstack/models/volume/volume_type'

module Fog
  module Volume
    class OpenStack
      class VolumeTypes < Fog::Collection
        model Fog::Volume::OpenStack::VolumeType

        def all(options = {})
          response = service.list_volume_types(options)
          load(response.body['volume_types'])
        end

        def get(volume_type_id)
          if volume_type = service.get_volume_type_details(volume_type_id).body['volume_type']
            new(volume_type)
          end
        rescue Fog::Volume::OpenStack::NotFound
          nil
        end
        alias_method :find_by_id, :get
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 5 rubygems

Version Path
fog-1.31.0 lib/fog/openstack/models/volume/volume_types.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/openstack/models/volume/volume_types.rb
fog-1.30.0 lib/fog/openstack/models/volume/volume_types.rb
fog-1.29.0 lib/fog/openstack/models/volume/volume_types.rb
fog-1.28.0 lib/fog/openstack/models/volume/volume_types.rb
fog-1.27.0 lib/fog/openstack/models/volume/volume_types.rb
fog-1.26.0 lib/fog/openstack/models/volume/volume_types.rb
fog-1.25.0 lib/fog/openstack/models/volume/volume_types.rb
nsidc-fog-1.24.1 lib/fog/openstack/models/volume/volume_types.rb
fog-1.24.0 lib/fog/openstack/models/volume/volume_types.rb
ns-fog-1.22.11 lib/fog/openstack/models/volume/volume_types.rb
ns-fog-1.22.10 lib/fog/openstack/models/volume/volume_types.rb
ns-fog-1.22.9 lib/fog/openstack/models/volume/volume_types.rb
ns-fog-1.22.8 lib/fog/openstack/models/volume/volume_types.rb
ns-fog-1.22.7 lib/fog/openstack/models/volume/volume_types.rb
ns-fog-1.22.6 lib/fog/openstack/models/volume/volume_types.rb
fog-1.23.0 lib/fog/openstack/models/volume/volume_types.rb
ns-fog-1.22.4 lib/fog/openstack/models/volume/volume_types.rb
ns-fog-1.22.3 lib/fog/openstack/models/volume/volume_types.rb
ns-fog-1.22.2 lib/fog/openstack/models/volume/volume_types.rb