Sha256: be662001fb4d87ed964881af85aad20f4b214906360732c775b215334a1a58f2

Contents?: true

Size: 705 Bytes

Versions: 34

Compression:

Stored size: 705 Bytes

Contents

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

module Fog
  module Compute
    class Vsphere
      class Snapshots < Fog::Collection
        attribute :server_id, :alias => :instance_uuid
        attribute :parent_snapshot
        model Fog::Compute::Vsphere::Snapshot

        def all(filters = {})
          if parent_snapshot
            load service.list_child_snapshots(parent_snapshot, filters)
          else
            requires :server_id
            load service.list_vm_snapshots(server_id, filters)
          end
        end

        def get(snapshot_ref)
          all.find { |snapshot| snapshot.get_child(snapshot_ref) }
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
fog-vsphere-1.7.0.1 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.10.0 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.9.2 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.9.1 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.9.0 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.8.0 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.7.1 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.7.0 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.6.0 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.5.2 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.5.1 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.5.0 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.4.0 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.3.0 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.2.2 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.2.1 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.2.0 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.1.0 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.0.1 lib/fog/vsphere/models/compute/snapshots.rb
fog-vsphere-1.0.0 lib/fog/vsphere/models/compute/snapshots.rb