This object defines the base class for a Network object.
Methods
|
|
|
|
__init__
|
__init__ (
self,
realmachines,
lanname,
subnet="",
dns_servers="",
**keywords,
)
|
|
__repr__
|
__repr__ ( self )
|
|
__str__
|
__str__ ( self )
|
|
_get_cables
|
_get_cables ( self )
Returns a list of cables associated with the Network.
>>> self._get_cables()
|
|
_get_dns_servers
|
_get_dns_servers ( self )
Returns a list of the DNS Servers associated with the Network.
>>> self._get_dns_servers()
|
|
_get_helpers
|
_get_helpers ( self )
Returns a list of the Helpers associated with the Network.
>>> self._get_helpers()
|
|
_get_lanname
|
_get_lanname ( self )
Returns the name of the Network.
>>> self._get_lanname()
|
|
_get_realmachine
|
_get_realmachine ( self )
Returns the primary real Machine associated with the Network.
>>> self._get_realmachine()
|
|
_get_realmachines
|
_get_realmachines ( self )
Returns a list of real Machines associated with the Network.
>>> self._get_realmachines()
|
|
_get_status
|
_get_status ( self )
Returns the status of the Network.
>>> self._get_status()
|
|
_get_subnet
|
_get_subnet ( self )
Returns the subnet of the Network.
>>> self._get_subnet()
|
|
_get_vms
|
_get_vms ( self )
Returns a list of VMs associated with the Network.
>>> self._get_vms()
|
|
add_helper
|
add_helper ( self, helper )
Associates a Helper with the Network.
>>> self.add_helper(helper)
helper = Helper
Exceptions
|
|
TypeError, ('Got %s for first argument to add_helper, expected subclass of %s' %( type( helper ), Helper ) )
|
|
|
add_ip
|
add_ip (
self,
vm,
ip,
)
Associates a VM to IP address mapping with the Network.
>>> self.add_ip(vm, ip)
vm = VM
ip is a string containing a single IP address, in the form xxx.xxx.xxx.xxx.
Exceptions
|
|
TypeError, ('Got %s for first argument to add_ip, expected subclass of %s' %( type( vm ), VM ) )
|
|
|
add_realmachine
|
add_realmachine ( self, realmachine )
Associates a real Machine with the Network.
>>> self.add_realmachine(realmachine)
realmachine = Machine
|
|
add_vm
|
add_vm ( self, vm )
Associates a VM object with the Network.
>>> self.add_vm(vm)
vm = VM
Exceptions
|
|
TypeError, ('Got %s for first argument to add_vm, expected subclass of %s' %( type( vm ), VM ) )
|
|
|
interface
|
interface ( self, realmachine )
Returns an interface associated with a Machine.
>>> self.interface(realmachine)
realmachine = Machine
Exceptions
|
|
KeyError, ("Can't find interface for %s on %s" %( realmachine.hostname, self.lanname ) )
|
|
|
ips
|
ips ( self, vm )
Returns a list of IPs corresponding to a VM.
>>> self.ips(vm)
vm = VM
Exceptions
|
|
AttributeError
TypeError, ('Got %s for first argument to ip, expected subclass of %s' %( type( vm ), IP ) )
|
|
|
pid
|
pid ( self, realmachine )
Returns a pid associated with a real Machine.
>>> self.pid(realmachine)
realmachine = Machine
|
|
start
|
start ( self )
Abstract method to start the Network object.
>>> self.start()
|
|
stop
|
stop ( self )
Abstract method to stop the Network object.
>>> self.stop()
|