module HashiCorp::VagrantVMwareDesktop::Cap::Snapshot
Public Class Methods
delete_all_snapshots(machine)
click to toggle source
Delete all snapshots for the machine
@param [Vagrant::Machine] machine - the current machine
# File lib/vagrant-vmware-desktop/cap/snapshot.rb, line 19 def self.delete_all_snapshots(machine) # To delete a snapshot with children of the same name, use the # full path to the snapshot. eg. /clone/clone if the machine # has 2 snapshots called "clone" snapshots = machine.provider.driver.snapshot_tree snapshots.sort {|x, y| y.length <=> x.length}.each do |snapshot| @@logger.info("Deleting snapshot #{snapshot}") machine.provider.driver.snapshot_delete(snapshot) end end
delete_snapshot(machine, snapshot_name)
click to toggle source
Delete a given snapstho
@param [Vagrant::Machine] machine - the current machine @param [String] snapshot_name - name of the snapshot to delete
# File lib/vagrant-vmware-desktop/cap/snapshot.rb, line 34 def self.delete_snapshot(machine, snapshot_name) @@logger.info("Deleting snapshot #{snapshot_name}") machine.provider.driver.snapshot_delete(snapshot_name) end
snapshot_list(machine)
click to toggle source
List snapshots
@param [Vagrant::Machine] machine - the current machine @return [List<String>] - snapshot names
# File lib/vagrant-vmware-desktop/cap/snapshot.rb, line 12 def self.snapshot_list(machine) machine.provider.driver.snapshot_tree end