Class: Fog::Compute::Vsphere::Snapshots

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/vsphere/models/compute/snapshots.rb

Instance Method Summary collapse

Instance Method Details

#all(filters = {}) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/fog/vsphere/models/compute/snapshots.rb', line 12

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

#get(snapshot_ref) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/fog/vsphere/models/compute/snapshots.rb', line 21

def get(snapshot_ref)
  all.each do |snapshot|
    snapshot = snapshot.get_child(snapshot_ref)
    return snapshot if snapshot
  end
  nil
end