Sha256: 27688cc40a44a1ff0937fee0526e5cf6fd591b4b998f972526741ef5ec07abf8

Contents?: true

Size: 572 Bytes

Versions: 11

Compression:

Stored size: 572 Bytes

Contents

require 'fog/core/collection'
require 'fog/rackspace/models/block_storage/snapshot'

module Fog
  module Rackspace
    class BlockStorage
      class Snapshots < Fog::Collection

        model Fog::Rackspace::BlockStorage::Snapshot

        def all
          data = connection.list_snapshots.body['snapshots']
          load(data)
        end

        def get(snapshot_id)
          data = connection.get_snapshot(snapshot_id).body['snapshot']
          new(data)
        rescue Fog::Rackspace::BlockStorage::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 7 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/rackspace/models/block_storage/snapshots.rb
fog-nirvanix-1.8.1 lib/fog/rackspace/models/block_storage/snapshots.rb
fog-parser-fix-1.6.1 lib/fog/rackspace/models/block_storage/snapshots.rb
fog-test-again-1.6.0 lib/fog/rackspace/models/block_storage/snapshots.rb
fog-parser-fix-1.6.0 lib/fog/rackspace/models/block_storage/snapshots.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/rackspace/models/block_storage/snapshots.rb
fog-sgonyea-1.8.1 lib/fog/rackspace/models/block_storage/snapshots.rb
fog-1.8.0 lib/fog/rackspace/models/block_storage/snapshots.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/rackspace/models/block_storage/snapshots.rb
fog-1.7.0 lib/fog/rackspace/models/block_storage/snapshots.rb
fog-1.6.0 lib/fog/rackspace/models/block_storage/snapshots.rb