Sha256: 602338cd06c6c3855de88fad05283e86986428330979cd83918acea59c825df7

Contents?: true

Size: 566 Bytes

Versions: 25

Compression:

Stored size: 566 Bytes

Contents

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

module Fog
  module Volume
    class OpenStack

      class Volumes < Fog::Collection
        model Fog::Volume::OpenStack::Volume

        def all(detailed=true)
          load(service.list_volumes(detailed).body['volumes'])
        end

        def find_by_id(volume_id)
          if volume = service.get_volume_details(volume_id).body['volume']
            new(volume)
          end
        rescue Fog::Volume::OpenStack::NotFound
          nil
        end
      end

    end
  end
end

Version data entries

25 entries across 25 versions & 7 rubygems

Version Path
cifrado-0.2.1 vendor/fog/lib/fog/openstack/models/volume/volumes.rb
cifrado-0.2.0 vendor/fog/lib/fog/openstack/models/volume/volumes.rb
gapinc-fog-1.12.1.2.1 lib/fog/openstack/models/volume/volumes.rb
gapinc-fog-1.12.1.2 lib/fog/openstack/models/volume/volumes.rb
gapinc-fog-1.12.1.1 lib/fog/openstack/models/volume/volumes.rb
gapinc-fog-1.12.1a lib/fog/openstack/models/volume/volumes.rb
gapinc-fog-1.12.1 lib/fog/openstack/models/volume/volumes.rb
fog-1.12.1 lib/fog/openstack/models/volume/volumes.rb
fog-1.12.0 lib/fog/openstack/models/volume/volumes.rb
hpfog-0.0.20 lib/fog/openstack/models/volume/volumes.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/openstack/models/volume/volumes.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/openstack/models/volume/volumes.rb
fog-1.11.1 lib/fog/openstack/models/volume/volumes.rb
fog-1.11.0 lib/fog/openstack/models/volume/volumes.rb
fog-1.10.1 lib/fog/openstack/models/volume/volumes.rb
fog-test-me-1.10.0 lib/fog/openstack/models/volume/volumes.rb
cifrado-0.1.3 vendor/fog/lib/fog/openstack/models/volume/volumes.rb
fog-1.10.0 lib/fog/openstack/models/volume/volumes.rb
cifrado-0.1.2 vendor/fog/lib/fog/openstack/models/volume/volumes.rb
cifrado-0.1.1 vendor/fog/lib/fog/openstack/models/volume/volumes.rb