Package pyvb :: Module vb :: Class VB
[hide private]
[frames] | no frames]

Class VB

source code

This class is meant to be an abstraction of the VirtualBox appliacation. So there should really only be one instance of this class although there is nothing preventing it from being instantiated multiple times.

Instance Methods [hide private]
 
__init__(self)
Constructor.
source code
pyvb.command.VBCommand
run(self, command)
Run the specified command on the command line.
source code
List
listVMS(self, uuid=None)
Return a list of VirtualBox virtual machines.
source code
List
listOsTypes(self)
Return a list of VitualBox-supported operating system types.
source code
List
listHostDvds(self)
Return a list of host DVDs.
source code
List
listDvds(self)
Return a list of DVDs used by virtual machines.
source code
List
listHdds(self, uuid=None)
Return a list of HDDs in use by VirtualBox.
source code
pyvb.vm.vbVM
getVM(self, uuid)
Return a specific VirtualBox virtual machine using the specified id.
source code
pyvb.hdd.vbHdd
getHDD(self, uuid)
Return a specific VirtualBox HDD using the specified id.
source code
 
startVM(self, vm, type='gui')
Start the specified VirtualBox virtual machine.
source code
 
poweroffVM(self, vm)
Poweroff the specified VirtualBox virtual machine.
source code
 
acpipoweroffVM(self, vm)
ACPI poweroff the specified VirtualBox virtual machine.
source code
 
pauseVM(self, vm)
Pause the specified VirtualBox virtual machine.
source code
 
resumeVM(self, vm)
Resume the specified VirtualBox virtual machine.
source code
pyvb.vm.vbVM
createVM(self, name)
Create a new virtual machine.
source code
pyvb.hdd.vbHdd
createVDI(self, filename, size)
Create a new disk-drive.
source code
pyvb.dvd.vbDvd
createDVD(self, filename)
Create a new DVD.
source code
None
attachVDI(self, vm, hdd)
Attach a disk-drive to a virtual machine.
source code
None
attachDVD(self, vm, dvd)
Attach a DVD to a virtual machine.
source code
 
cloneVDI(self, hdd, path) source code
Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructor. Does nothing at this point.

run(self, command)

source code 

Run the specified command on the command line.

Parameters:
Returns: pyvb.command.VBCommand
The command object that was run.

listVMS(self, uuid=None)

source code 

Return a list of VirtualBox virtual machines. First we check if a specific machine is being requested. In this case, we fetch a single VM by altering the command that is run. Even if a single VM is requested, a list is still returned so the interface will remain unchanged. If a specific machine is not requested, a list of all VMs is returned.

Parameters:
  • uuid (String) - The id of a machine to retrieve.
Returns: List
A list of pyvb.vm.vbVM instances.

listOsTypes(self)

source code 

Return a list of VitualBox-supported operating system types.

Returns: List
A list of pyvb.ostype.vbOsType instances.

listHostDvds(self)

source code 

Return a list of host DVDs.

Returns: List
A list of pyvb.dvd.vbHostDvd instances.

listDvds(self)

source code 

Return a list of DVDs used by virtual machines.

Returns: List
A list of pyvb.dvd.vbDvd instances.

listHdds(self, uuid=None)

source code 

Return a list of HDDs in use by VirtualBox. First, we check if a specific HDD was requested. In this case, we fetch a single HDD by altering the command that is run. Even if a single HDD is requested, a list is still returned so the interface will remain unchanged. If a specific HDD is requested, a list of all HDDs is returned.

Returns: List
A list of pyvb.hdd.vbHdd instances.

getVM(self, uuid)

source code 

Return a specific VirtualBox virtual machine using the specified id.

Parameters:
  • uuid (String) - The id of the machine to retrieve.
Returns: pyvb.vm.vbVM
The specified VirtualBox virtual machine.

getHDD(self, uuid)

source code 

Return a specific VirtualBox HDD using the specified id.

Parameters:
  • uuid (String) - The id of the HDD to retrieve.
Returns: pyvb.hdd.vbHdd
The specified VirtualBox HDD.

startVM(self, vm, type='gui')

source code 

Start the specified VirtualBox virtual machine.

Parameters:

poweroffVM(self, vm)

source code 

Poweroff the specified VirtualBox virtual machine.

Parameters:

acpipoweroffVM(self, vm)

source code 

ACPI poweroff the specified VirtualBox virtual machine.

Parameters:

pauseVM(self, vm)

source code 

Pause the specified VirtualBox virtual machine.

Parameters:

resumeVM(self, vm)

source code 

Resume the specified VirtualBox virtual machine.

Parameters:

createVM(self, name)

source code 

Create a new virtual machine.

Parameters:
  • name (String) - The name of the new machine.
Returns: pyvb.vm.vbVM
A new pyvb.vm.vbVM instance.

createVDI(self, filename, size)

source code 

Create a new disk-drive.

Parameters:
  • filename (String) - The location of the disk file.
  • size (Int) - The size of the disk file in megabytes.
Returns: pyvb.hdd.vbHdd
A new pyvb.hdd.vbHdd instance.

createDVD(self, filename)

source code 

Create a new DVD.

Parameters:
  • filename (String) - The location of the ISO file.
Returns: pyvb.dvd.vbDvd
A new pyvb.dvd.vbDvd instance.

attachVDI(self, vm, hdd)

source code 

Attach a disk-drive to a virtual machine.

Parameters:
  • vm (pyvb.vm.vbVM) - The virtual machine we are attaching the disk-drive to.
  • hdd (pyvb.hdd.vbHdd) - The disk-drive we are attaching.
Returns: None
None

attachDVD(self, vm, dvd)

source code 

Attach a DVD to a virtual machine.

Parameters:
Returns: None
None