Class: Fog::Vsphere::Compute::Snapshot

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/vsphere/models/compute/snapshot.rb

Instance Method Summary collapse

Instance Method Details

#child_snapshots(filters = {}) ⇒ Object



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

def child_snapshots(filters = {})
  service.snapshots(
    { server_id: server_id, parent_snapshot: self }.update(filters)
  )
end

#destroy(remove_children = false) ⇒ Object



36
37
38
39
# File 'lib/fog/vsphere/models/compute/snapshot.rb', line 36

def destroy(remove_children = false)
  requires :server_id, :ref
  service.vm_remove_snapshot(server_id, ref, remove_children)
end

#get_child(snapshot_ref) ⇒ Object



27
28
29
30
# File 'lib/fog/vsphere/models/compute/snapshot.rb', line 27

def get_child(snapshot_ref)
  return self if ref == snapshot_ref
  child_snapshots.get(snapshot_ref)
end

#revertObject



32
33
34
# File 'lib/fog/vsphere/models/compute/snapshot.rb', line 32

def revert
  service.vm_revert_snapshot server_id, ref
end