Sha256: f2b83b2a509999aaa531d82f3277a53b6380f080600e1565cf2f0f4b48d25c70

Contents?: true

Size: 590 Bytes

Versions: 13

Compression:

Stored size: 590 Bytes

Contents

require 'fog/core/collection'
require 'fog/openstack/models/compute/snapshot'

module Fog
  module Compute
    class OpenStack

      class Snapshots < Fog::Collection
        model Fog::Compute::OpenStack::Snapshot

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

        def get(snapshot_id)
          if snapshot = connection.get_snapshot_details(snapshot_id).body['snapshot']
            new(snapshot)
          end
        rescue Fog::Compute::OpenStack::NotFound
          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/openstack/models/compute/snapshots.rb
fog-nirvanix-1.8.1 lib/fog/openstack/models/compute/snapshots.rb
fog-parser-fix-1.6.1 lib/fog/openstack/models/compute/snapshots.rb
fog-test-again-1.6.0 lib/fog/openstack/models/compute/snapshots.rb
fog-parser-fix-1.6.0 lib/fog/openstack/models/compute/snapshots.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/openstack/models/compute/snapshots.rb
fog-sgonyea-1.8.1 lib/fog/openstack/models/compute/snapshots.rb
fog-1.8.0 lib/fog/openstack/models/compute/snapshots.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/openstack/models/compute/snapshots.rb
fog-1.7.0 lib/fog/openstack/models/compute/snapshots.rb
fog-1.6.0 lib/fog/openstack/models/compute/snapshots.rb
fog-1.5.0 lib/fog/openstack/models/compute/snapshots.rb
fog-1.4.0 lib/fog/openstack/models/compute/snapshots.rb