Class: RVC::RootSnapshotFolder

Inherits:
Object
  • Object
show all
Includes:
InventoryObject
Defined in:
lib/rvc/extensions/VirtualMachine.rb

Instance Attribute Summary

Attributes included from InventoryObject

#rvc_arc, #rvc_parent

Instance Method Summary collapse

Methods included from InventoryObject

included, #ls_text, #rvc_link, #rvc_path, #rvc_path_str, #rvc_relative_path, #rvc_relative_path_str, #traverse_one

Methods included from ObjectWithFields::ClassMethods

#field, #fields

Methods included from ObjectWithFields

#field, #field_properties, #perfmetrics

Constructor Details

#initialize(vm) ⇒ RootSnapshotFolder

Returns a new instance of RootSnapshotFolder.



245
246
247
# File 'lib/rvc/extensions/VirtualMachine.rb', line 245

def initialize vm
  @vm = vm
end

Instance Method Details

#childrenObject



249
250
251
252
253
# File 'lib/rvc/extensions/VirtualMachine.rb', line 249

def children
  info = @vm.snapshot
  return {} unless info
  Hash[info.rootSnapshotList.map { |x| [x.name, RVC::SnapshotFolder.new(@vm, [x.id])] }]
end

#display_infoObject



255
256
257
# File 'lib/rvc/extensions/VirtualMachine.rb', line 255

def display_info
  puts "Root of a VM's snapshot tree"
end