Class: Virtuoso::API::Hypervisor
- Inherits:
-
Object
- Object
- Virtuoso::API::Hypervisor
- 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
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
The libvirt connection instance.
Instance Method Summary collapse
-
#find(id) ⇒ VM
Searches for a VM with the given ID and returns it if it finds it, and otherwise returns nil.
-
#initialize(connection) ⇒ Hypervisor
constructor
Initializes a hypervisor with the given libvirt connection.
-
#new_vm ⇒ VM
Returns a new VM instance that can be used to create a new virtual machine.
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
#connection ⇒ Object (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.
27 |
# File 'lib/virtuoso/api/hypervisor.rb', line 27 def find(id); end |