Class: Virtuoso::API::Hypervisor

Inherits:
Object
  • Object
show all
Defined in:
lib/virtuoso/api/hypervisor.rb

Overview

Base class specifying the API for all hypervisors. Every feature in this base class must be overloaded by any hypervisors.

Direct Known Subclasses

VirtualBox::Hypervisor

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Hypervisor

Initializes a hypervisor with the given libvirt connection. The connection should be established through Virtuoso.connect, which also chooses the correct hypervisor.



12
13
14
# File 'lib/virtuoso/api/hypervisor.rb', line 12

def initialize(connection)
  @connection = connection
end

Instance Attribute Details

#connectionObject (readonly)

The libvirt connection instance.



7
8
9
# File 'lib/virtuoso/api/hypervisor.rb', line 7

def connection
  @connection
end

Instance Method Details

#find(id) ⇒ VM

Searches for a VM with the given ID and returns it if it finds it, and otherwise returns nil. The exact semantics of the find are up to the hypervisor but typically it searches by both name and UUID.

Returns:



27
# File 'lib/virtuoso/api/hypervisor.rb', line 27

def find(id); end

#new_vmVM

Returns a new VM instance that can be used to create a new virtual machine.

Returns:



20
# File 'lib/virtuoso/api/hypervisor.rb', line 20

def new_vm; end