Sha256: 936d1cd776a5c9211685e6634e4927429694edd996e61a0da88d76cbafe6466a

Contents?: true

Size: 621 Bytes

Versions: 13

Compression:

Stored size: 621 Bytes

Contents

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

module Fog
  module Compute
    class Cloudstack

      class Volumes < Fog::Collection

        model Fog::Compute::Cloudstack::Volume

        def all
          data = connection.list_volumes["listvolumesresponse"]["volume"] || []
          load(data)
        end

        def get(volume_id)
          if volume = connection.list_volumes('id' => volume_id)["listvolumesresponse"]["volume"].first
            new(volume)
          end
        rescue Fog::Compute::Cloudstack::BadRequest
          nil
        end
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 7 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/cloudstack/models/compute/volumes.rb
fog-nirvanix-1.8.1 lib/fog/cloudstack/models/compute/volumes.rb
fog-parser-fix-1.6.1 lib/fog/cloudstack/models/compute/volumes.rb
fog-test-again-1.6.0 lib/fog/cloudstack/models/compute/volumes.rb
fog-parser-fix-1.6.0 lib/fog/cloudstack/models/compute/volumes.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/cloudstack/models/compute/volumes.rb
fog-sgonyea-1.8.1 lib/fog/cloudstack/models/compute/volumes.rb
fog-1.8.0 lib/fog/cloudstack/models/compute/volumes.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/cloudstack/models/compute/volumes.rb
fog-1.7.0 lib/fog/cloudstack/models/compute/volumes.rb
fog-1.6.0 lib/fog/cloudstack/models/compute/volumes.rb
fog-1.5.0 lib/fog/cloudstack/models/compute/volumes.rb
fog-1.4.0 lib/fog/cloudstack/models/compute/volumes.rb