Class: Vixen::CommandLine::Snapshot
- Inherits:
-
Base
- Object
- Base
- Vixen::CommandLine::Snapshot
show all
- Defined in:
- lib/vixen/command_line/snapshot.rb
Instance Attribute Summary
Attributes inherited from Base
#context, #start
Instance Method Summary
collapse
Methods inherited from Base
#elapsed_time, #host, #initialize, #new_line_after, #print, #puts, #vms
Instance Method Details
#create ⇒ Object
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/vixen/command_line/snapshot.rb', line 36
def create
snapshot_name = ARGV.shift
vms.each do |vm|
new_line_after do
vm.create_snapshot(snapshot_name) do |job_handle, event_type, more_event_info, client_data|
print "Creating #{snapshot_name} snapshot on #{vm.name}"
end
end
end
end
|
#current ⇒ Object
29
30
31
32
33
34
|
# File 'lib/vixen/command_line/snapshot.rb', line 29
def current
vms.each do |vm|
puts "#{vm.name}"
puts " - #{vm.current_snapshot.full_name}"
end
end
|
#default_action ⇒ Object
53
54
55
|
# File 'lib/vixen/command_line/snapshot.rb', line 53
def default_action
'list'
end
|
#execute ⇒ Object
4
5
6
7
8
9
10
11
12
13
|
# File 'lib/vixen/command_line/snapshot.rb', line 4
def execute
action = ARGV.shift
action ||= default_action
action = action.to_sym
if defined? action
send action
end
end
|
#list ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/vixen/command_line/snapshot.rb', line 15
def list
total_snapshots = 0
vms.each do |vm|
puts "#{vm.name} : (#{vm.current_snapshot.display_name})"
all_snaps = vm.all_snapshots
total_snapshots += all_snaps.count
all_snaps.each do |snap|
puts " - #{snap.display_name}"
end
end
puts "Found #{total_snapshots} snapshots on #{vms.count} virtual machines"
end
|
#remove ⇒ Object
50
51
|
# File 'lib/vixen/command_line/snapshot.rb', line 50
def remove
end
|
#revert ⇒ Object
47
48
|
# File 'lib/vixen/command_line/snapshot.rb', line 47
def revert
end
|