1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 03:08:14 +00:00

Renaming things & more inline docs.

This commit is contained in:
grossmj 2014-02-27 21:50:46 -07:00
parent d68a24e39d
commit 687d5b75ab
35 changed files with 82 additions and 96 deletions

View File

@ -34,8 +34,8 @@ class JSONRPCWebSocket(tornado.websocket.WebSocketHandler):
STOMP protocol over Tornado Websockets with message STOMP protocol over Tornado Websockets with message
routing to ZeroMQ dealer clients. routing to ZeroMQ dealer clients.
:param application: Tornado Application object :param application: Tornado Application instance
:param request: Tornado Request object :param request: Tornado Request instance
:param zmq_router: ZeroMQ router socket :param zmq_router: ZeroMQ router socket
""" """

View File

@ -68,7 +68,7 @@ class IModule(multiprocessing.Process):
""" """
Creates a new ZMQ stream. Creates a new ZMQ stream.
:returns: ZMQ stream object :returns: ZMQ stream instance
""" """
socket = self._context.socket(zmq.DEALER) socket = self._context.socket(zmq.DEALER)

View File

@ -72,7 +72,7 @@ class Adapter(object):
Installs a WIC on this adapter. Installs a WIC on this adapter.
:param wic_slot_id: WIC slot ID (integer) :param wic_slot_id: WIC slot ID (integer)
:param wic: WIC object :param wic: WIC instance
""" """
self._wics[wic_slot_id] = wic self._wics[wic_slot_id] = wic
@ -110,7 +110,7 @@ class Adapter(object):
Adds a NIO to a port on this adapter. Adds a NIO to a port on this adapter.
:param port_id: port ID (integer) :param port_id: port ID (integer)
:param nio: NIO object :param nio: NIO instance
""" """
self._ports[port_id] = nio self._ports[port_id] = nio
@ -130,7 +130,7 @@ class Adapter(object):
:params port_id: port ID (integer) :params port_id: port ID (integer)
:returns: NIO object :returns: NIO instance
""" """
return self._ports[port_id] return self._ports[port_id]
@ -160,7 +160,7 @@ class Adapter(object):
""" """
Returns the wics adapters inserted in this adapter. Returns the wics adapters inserted in this adapter.
:returns: list WIC objects :returns: list WIC instances
""" """
return self._wics return self._wics

View File

@ -41,10 +41,6 @@ class ATMSW(object):
:param request: JSON request :param request: JSON request
""" """
if request == None:
self.send_param_error()
return
#TODO: JSON schema validation for the request #TODO: JSON schema validation for the request
name = None name = None
if request and "name" in request: if request and "name" in request:
@ -137,10 +133,10 @@ class ATMSW(object):
Mandatory request parameters: Mandatory request parameters:
- id (switch identifier) - id (switch identifier)
- port_name (port name) - port_id (port identifier)
Response parameters: Response parameters:
- port_name (port name) - port_id (port identifier)
- lhost (local host address) - lhost (local host address)
- lport (allocated local port) - lport (allocated local port)
@ -163,7 +159,7 @@ class ATMSW(object):
self.send_custom_error(str(e)) self.send_custom_error(str(e))
return return
response["port_name"] = request["port_name"] response["port_id"] = request["port_id"]
self.send_response(response) self.send_response(response)
@IModule.route("dynamips.atmsw.add_nio") @IModule.route("dynamips.atmsw.add_nio")
@ -174,6 +170,7 @@ class ATMSW(object):
Mandatory request parameters: Mandatory request parameters:
- id (switch identifier) - id (switch identifier)
- port (port identifier) - port (port identifier)
- port_id (port identifier)
- mappings (VCs/VPs mapped to the port) - mappings (VCs/VPs mapped to the port)
- nio (nio type, one of the following) - nio (nio type, one of the following)
- "NIO_UDP" - "NIO_UDP"

View File

@ -40,10 +40,6 @@ class ETHHUB(object):
:param request: JSON request :param request: JSON request
""" """
if request == None:
self.send_param_error()
return
#TODO: JSON schema validation for the request #TODO: JSON schema validation for the request
name = None name = None
if request and "name" in request: if request and "name" in request:
@ -136,10 +132,10 @@ class ETHHUB(object):
Mandatory request parameters: Mandatory request parameters:
- id (hub identifier) - id (hub identifier)
- port_name (port name) - port_id (port identifier)
Response parameters: Response parameters:
- port_name (port name) - port_id (port identifier)
- lhost (local host address) - lhost (local host address)
- lport (allocated local port) - lport (allocated local port)
@ -162,7 +158,7 @@ class ETHHUB(object):
self.send_custom_error(str(e)) self.send_custom_error(str(e))
return return
response["port_name"] = request["port_name"] response["port_id"] = request["port_id"]
self.send_response(response) self.send_response(response)
@IModule.route("dynamips.ethhub.add_nio") @IModule.route("dynamips.ethhub.add_nio")
@ -173,6 +169,7 @@ class ETHHUB(object):
Mandatory request parameters: Mandatory request parameters:
- id (hub identifier) - id (hub identifier)
- port (port identifier) - port (port identifier)
- port_id (port identifier)
- nio (nio type, one of the following) - nio (nio type, one of the following)
- "NIO_UDP" - "NIO_UDP"
- lport (local port) - lport (local port)

View File

@ -40,10 +40,6 @@ class ETHSW(object):
:param request: JSON request :param request: JSON request
""" """
if request == None:
self.send_param_error()
return
#TODO: JSON schema validation for the request #TODO: JSON schema validation for the request
name = None name = None
if request and "name" in request: if request and "name" in request:
@ -153,10 +149,10 @@ class ETHSW(object):
Mandatory request parameters: Mandatory request parameters:
- id (switch identifier) - id (switch identifier)
- port_name (port name) - port_id (port identifier)
Response parameters: Response parameters:
- port_name (port name) - port_id (port identifier)
- lhost (local host address) - lhost (local host address)
- lport (allocated local port) - lport (allocated local port)
@ -179,7 +175,7 @@ class ETHSW(object):
self.send_custom_error(str(e)) self.send_custom_error(str(e))
return return
response["port_name"] = request["port_name"] response["port_id"] = request["port_id"]
self.send_response(response) self.send_response(response)
@IModule.route("dynamips.ethsw.add_nio") @IModule.route("dynamips.ethsw.add_nio")
@ -190,6 +186,7 @@ class ETHSW(object):
Mandatory request parameters: Mandatory request parameters:
- id (switch identifier) - id (switch identifier)
- port (port identifier) - port (port identifier)
- port_id (port identifier)
- vlan (vlan identifier) - vlan (vlan identifier)
- port_type ("access", "dot1q" or "qinq") - port_type ("access", "dot1q" or "qinq")
- nio (nio type, one of the following) - nio (nio type, one of the following)

View File

@ -40,10 +40,6 @@ class FRSW(object):
:param request: JSON request :param request: JSON request
""" """
if request == None:
self.send_param_error()
return
#TODO: JSON schema validation for the request #TODO: JSON schema validation for the request
name = None name = None
if request and "name" in request: if request and "name" in request:
@ -135,10 +131,10 @@ class FRSW(object):
Mandatory request parameters: Mandatory request parameters:
- id (switch identifier) - id (switch identifier)
- port_name (port name) - port_id (port identifier)
Response parameters: Response parameters:
- port_name (port name) - port_id (port identifier)
- lhost (local host address) - lhost (local host address)
- lport (allocated local port) - lport (allocated local port)
@ -161,7 +157,7 @@ class FRSW(object):
self.send_custom_error(str(e)) self.send_custom_error(str(e))
return return
response["port_name"] = request["port_name"] response["port_id"] = request["port_id"]
self.send_response(response) self.send_response(response)
@IModule.route("dynamips.frsw.add_nio") @IModule.route("dynamips.frsw.add_nio")
@ -172,6 +168,7 @@ class FRSW(object):
Mandatory request parameters: Mandatory request parameters:
- id (switch identifier) - id (switch identifier)
- port (port identifier) - port (port identifier)
- port_id (port identifier)
- mappings (VCs mapped to the port) - mappings (VCs mapped to the port)
- nio (nio type, one of the following) - nio (nio type, one of the following)
- "NIO_UDP" - "NIO_UDP"

View File

@ -445,10 +445,10 @@ class VM(object):
Mandatory request parameters: Mandatory request parameters:
- id (vm identifier) - id (vm identifier)
- port_name (port name e.g fastEthernet1/0) - port_id (unique port identifier)
Response parameters: Response parameters:
- port_name (port name e.g fastEthernet1/0) - port_id (unique port identifier)
- lhost (local host address) - lhost (local host address)
- lport (allocated local port) - lport (allocated local port)
@ -471,7 +471,7 @@ class VM(object):
self.send_custom_error(str(e)) self.send_custom_error(str(e))
return return
response["port_name"] = request["port_name"] response["port_id"] = request["port_id"]
self.send_response(response) self.send_response(response)
@IModule.route("dynamips.vm.add_nio") @IModule.route("dynamips.vm.add_nio")
@ -481,8 +481,9 @@ class VM(object):
Mandatory request parameters: Mandatory request parameters:
- id (vm identifier) - id (vm identifier)
- slot (slot identifier) - slot (slot number)
- port (port identifier) - port (port number)
- port_id (unique port identifier)
- nio (nio type, one of the following) - nio (nio type, one of the following)
- "NIO_UDP" - "NIO_UDP"
- lport (local port) - lport (local port)

View File

@ -158,7 +158,7 @@ class DynamipsHypervisor(object):
def save_config(self, filename): def save_config(self, filename):
""" """
Saves the configuration of all Dynamips objects into the specified file. Saves the configuration of all Dynamips instances into the specified file.
:param filename: path string :param filename: path string
""" """
@ -181,7 +181,7 @@ class DynamipsHypervisor(object):
""" """
Returns the current socket used to communicate with this hypervisor. Returns the current socket used to communicate with this hypervisor.
:returns: socket object :returns: socket instance
""" """
assert self._socket assert self._socket
@ -192,7 +192,7 @@ class DynamipsHypervisor(object):
""" """
Returns the list of devices managed by this hypervisor instance. Returns the list of devices managed by this hypervisor instance.
:returns: a list of device objects :returns: a list of device instances
""" """
return self._devices return self._devices
@ -287,7 +287,7 @@ class DynamipsHypervisor(object):
Adds a ghost name to the list of ghosts created on this hypervisor. Adds a ghost name to the list of ghosts created on this hypervisor.
:param image_name: name of the ghost image :param image_name: name of the ghost image
:param router: router object :param router: Router instance
""" """
self._ghosts[image_name] = router self._ghosts[image_name] = router
@ -344,10 +344,8 @@ class DynamipsHypervisor(object):
#FIXME: better check for IPv6 #FIXME: better check for IPv6
start_port = self._current_udp_port start_port = self._current_udp_port
print("start port = {}".format(start_port))
end_port = start_port + max_port end_port = start_port + max_port
for port in range(start_port, end_port): for port in range(start_port, end_port):
print(port)
if port > end_port: if port > end_port:
raise DynamipsError("Could not find a free port between {0} and {1}".format(start_port, max_port)) raise DynamipsError("Could not find a free port between {0} and {1}".format(start_port, max_port))
try: try:
@ -360,7 +358,6 @@ class DynamipsHypervisor(object):
s.bind((self._host, port)) s.bind((self._host, port))
#FIXME: increment? #FIXME: increment?
self._current_udp_port += 1 self._current_udp_port += 1
print("current port = {}".format(self._current_udp_port))
return port return port
except socket.error as e: except socket.error as e:
if e.errno == errno.EADDRINUSE: # socket already in use if e.errno == errno.EADDRINUSE: # socket already in use

View File

@ -81,7 +81,7 @@ class HypervisorManager(object):
""" """
Returns all hypervisor instances. Returns all hypervisor instances.
:returns: list of hypervisor objects :returns: list of hypervisor instances
""" """
return self._hypervisors return self._hypervisors
@ -430,7 +430,7 @@ class HypervisorManager(object):
""" """
Creates a new Dynamips process and start it. Creates a new Dynamips process and start it.
:returns: the new hypervisor object :returns: the new hypervisor instance
""" """
hypervisor = Hypervisor(self._path, hypervisor = Hypervisor(self._path,
@ -461,7 +461,7 @@ class HypervisorManager(object):
:param router_ios_image: IOS image name :param router_ios_image: IOS image name
:param router_ram: amount of RAM (integer) :param router_ram: amount of RAM (integer)
:returns: the allocated hypervisor object :returns: the allocated hypervisor instance
""" """
# allocate an hypervisor for each router by default # allocate an hypervisor for each router by default
@ -490,7 +490,7 @@ class HypervisorManager(object):
""" """
Unallocates a Dynamips hypervisor for a specific router. Unallocates a Dynamips hypervisor for a specific router.
:param router: router object :param router: Router instance
""" """
hypervisor = router.hypervisor hypervisor = router.hypervisor
@ -512,7 +512,7 @@ class HypervisorManager(object):
""" """
Allocates a Dynamips hypervisor for a specific Dynamips simulated device. Allocates a Dynamips hypervisor for a specific Dynamips simulated device.
:returns: the allocated hypervisor object :returns: the allocated hypervisor instance
""" """
# For now always allocate the first hypervisor available, # For now always allocate the first hypervisor available,
@ -528,7 +528,7 @@ class HypervisorManager(object):
""" """
Unallocates a Dynamips hypervisor for a specific Dynamips simulated device. Unallocates a Dynamips hypervisor for a specific Dynamips simulated device.
:param device: device object :param device: device instance
""" """
hypervisor = device.hypervisor hypervisor = device.hypervisor

View File

@ -30,7 +30,7 @@ class NIO(object):
""" """
Base NIO class Base NIO class
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
""" """
def __init__(self, hypervisor): def __init__(self, hypervisor):

View File

@ -29,7 +29,7 @@ class NIO_FIFO(NIO):
""" """
Dynamips FIFO NIO. Dynamips FIFO NIO.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
""" """
_instance_count = 0 _instance_count = 0
@ -59,7 +59,7 @@ class NIO_FIFO(NIO):
""" """
Establishes a cross-connect between this FIFO NIO and another one. Establishes a cross-connect between this FIFO NIO and another one.
:param nio: FIFO NIO object. :param nio: FIFO NIO instance
""" """
self._hypervisor.send("nio crossconnect_fifo {name} {nio}".format(name=self._name, self._hypervisor.send("nio crossconnect_fifo {name} {nio}".format(name=self._name,

View File

@ -29,7 +29,7 @@ class NIO_GenericEthernet(NIO):
""" """
Dynamips generic Ethernet NIO. Dynamips generic Ethernet NIO.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param ethernet_device: Ethernet device name (e.g. eth0) :param ethernet_device: Ethernet device name (e.g. eth0)
""" """

View File

@ -29,7 +29,7 @@ class NIO_LinuxEthernet(NIO):
""" """
Dynamips Linux Ethernet NIO. Dynamips Linux Ethernet NIO.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param ethernet_device: Ethernet device name (e.g. eth0) :param ethernet_device: Ethernet device name (e.g. eth0)
""" """

View File

@ -29,7 +29,7 @@ class NIO_Mcast(NIO):
""" """
Dynamips Linux Ethernet NIO. Dynamips Linux Ethernet NIO.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param group: multicast group to bind :param group: multicast group to bind
:param port: port for binding :param port: port for binding
""" """

View File

@ -29,7 +29,7 @@ class NIO_Null(NIO):
""" """
Dynamips NULL NIO. Dynamips NULL NIO.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
""" """
_instance_count = 0 _instance_count = 0

View File

@ -29,7 +29,7 @@ class NIO_TAP(NIO):
""" """
Dynamips TAP NIO. Dynamips TAP NIO.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param tap_device: TAP device name (e.g. tap0) :param tap_device: TAP device name (e.g. tap0)
""" """

View File

@ -29,7 +29,7 @@ class NIO_UDP(NIO):
""" """
Dynamips UDP NIO. Dynamips UDP NIO.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param lport: local port number :param lport: local port number
:param rhost: remote address/host :param rhost: remote address/host
:param rport: remote port number :param rport: remote port number

View File

@ -29,7 +29,7 @@ class NIO_UDP_auto(NIO):
""" """
Dynamips auto UDP NIO. Dynamips auto UDP NIO.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param laddr: local address :param laddr: local address
:param lport_start: start local port range :param lport_start: start local port range
:param lport_end: end local port range :param lport_end: end local port range

View File

@ -29,7 +29,7 @@ class NIO_UNIX(NIO):
""" """
Dynamips UNIX NIO. Dynamips UNIX NIO.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param local_file: local UNIX socket filename :param local_file: local UNIX socket filename
:param remote_file: remote UNIX socket filename :param remote_file: remote UNIX socket filename
""" """

View File

@ -29,7 +29,7 @@ class NIO_VDE(NIO):
""" """
Dynamips VDE NIO. Dynamips VDE NIO.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param control_file: VDE control filename :param control_file: VDE control filename
:param local_file: VDE local filename :param local_file: VDE local filename
""" """

View File

@ -28,7 +28,7 @@ class ATMBridge(object):
""" """
Dynamips bridge switch. Dynamips bridge switch.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param name: name for this switch :param name: name for this switch
""" """
@ -69,7 +69,7 @@ class ATMBridge(object):
""" """
Returns the current hypervisor. Returns the current hypervisor.
:returns: hypervisor object :returns: hypervisor instance
""" """
return self._hypervisor return self._hypervisor
@ -115,7 +115,7 @@ class ATMBridge(object):
""" """
Adds a NIO as new port on ATM bridge. Adds a NIO as new port on ATM bridge.
:param nio: NIO object to add :param nio: NIO instance to add
:param port: port to allocate for the NIO :param port: port to allocate for the NIO
""" """

View File

@ -31,7 +31,7 @@ class ATMSwitch(object):
""" """
Dynamips ATM switch. Dynamips ATM switch.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param name: name for this switch :param name: name for this switch
""" """
@ -121,7 +121,7 @@ class ATMSwitch(object):
""" """
Returns the current hypervisor. Returns the current hypervisor.
:returns: hypervisor object :returns: hypervisor instance
""" """
return self._hypervisor return self._hypervisor
@ -182,7 +182,7 @@ class ATMSwitch(object):
""" """
Adds a NIO as new port on ATM switch. Adds a NIO as new port on ATM switch.
:param nio: NIO object to add :param nio: NIO instance to add
:param port: port to allocate for the NIO :param port: port to allocate for the NIO
""" """

View File

@ -27,7 +27,7 @@ class Bridge(object):
""" """
Dynamips bridge. Dynamips bridge.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param name: name for this bridge :param name: name for this bridge
""" """
@ -73,7 +73,7 @@ class Bridge(object):
""" """
Returns the current hypervisor. Returns the current hypervisor.
:returns: hypervisor object :returns: hypervisor instance
""" """
return self._hypervisor return self._hypervisor
@ -110,7 +110,7 @@ class Bridge(object):
""" """
Adds a NIO as new port on this bridge. Adds a NIO as new port on this bridge.
:param nio: NIO object to add :param nio: NIO instance to add
""" """
self._hypervisor.send("nio_bridge add_nio {name} {nio}".format(name=self._name, self._hypervisor.send("nio_bridge add_nio {name} {nio}".format(name=self._name,
@ -121,7 +121,7 @@ class Bridge(object):
""" """
Removes the specified NIO as member of this bridge. Removes the specified NIO as member of this bridge.
:param nio: NIO object to remove :param nio: NIO instance to remove
""" """
self._hypervisor.send("nio_bridge remove_nio {name} {nio}".format(name=self._name, self._hypervisor.send("nio_bridge remove_nio {name} {nio}".format(name=self._name,

View File

@ -33,7 +33,7 @@ class C1700(Router):
""" """
Dynamips c1700 router. Dynamips c1700 router.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param name: name for this router :param name: name for this router
:param chassis: chassis for this router: :param chassis: chassis for this router:
1720, 1721, 1750, 1751 or 1760 (default = 1720). 1720, 1721, 1750, 1751 or 1760 (default = 1720).

View File

@ -35,7 +35,7 @@ class C2600(Router):
""" """
Dynamips c2600 router. Dynamips c2600 router.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param name: name for this router :param name: name for this router
:param chassis: chassis for this router: :param chassis: chassis for this router:
2610, 2611, 2620, 2621, 2610XM, 2611XM 2610, 2611, 2620, 2621, 2610XM, 2611XM

View File

@ -32,7 +32,7 @@ class C2691(Router):
""" """
Dynamips c2691 router. Dynamips c2691 router.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param name: name for this router :param name: name for this router
""" """

View File

@ -32,7 +32,7 @@ class C3600(Router):
""" """
Dynamips c3600 router. Dynamips c3600 router.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param name: name for this router :param name: name for this router
:param chassis: chassis for this router: :param chassis: chassis for this router:
3620, 3640 or 3660 (default = 3640). 3620, 3640 or 3660 (default = 3640).

View File

@ -32,7 +32,7 @@ class C3725(Router):
""" """
Dynamips c3725 router. Dynamips c3725 router.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param name: name for this router :param name: name for this router
""" """

View File

@ -32,7 +32,7 @@ class C3745(Router):
""" """
Dynamips c3745 router. Dynamips c3745 router.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param name: name for this router :param name: name for this router
""" """

View File

@ -34,7 +34,7 @@ class C7200(Router):
""" """
Dynamips c7200 router (model is 7206). Dynamips c7200 router (model is 7206).
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param name: name for this router :param name: name for this router
:param npe: default NPE :param npe: default NPE
""" """

View File

@ -32,7 +32,7 @@ class EthernetSwitch(object):
""" """
Dynamips Ethernet switch. Dynamips Ethernet switch.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param name: name for this switch :param name: name for this switch
""" """
@ -122,7 +122,7 @@ class EthernetSwitch(object):
""" """
Returns the current hypervisor. Returns the current hypervisor.
:returns: hypervisor object :returns: hypervisor instance
""" """
return self._hypervisor return self._hypervisor
@ -172,7 +172,7 @@ class EthernetSwitch(object):
""" """
Adds a NIO as new port on Ethernet switch. Adds a NIO as new port on Ethernet switch.
:param nio: NIO object to add :param nio: NIO instance to add
:param port: port to allocate for the NIO :param port: port to allocate for the NIO
""" """

View File

@ -31,7 +31,7 @@ class FrameRelaySwitch(object):
""" """
Dynamips Frame Relay switch. Dynamips Frame Relay switch.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param name: name for this switch :param name: name for this switch
""" """
@ -121,7 +121,7 @@ class FrameRelaySwitch(object):
""" """
Returns the current hypervisor. Returns the current hypervisor.
:returns: hypervisor object :returns: hypervisor instance
""" """
return self._hypervisor return self._hypervisor
@ -182,7 +182,7 @@ class FrameRelaySwitch(object):
""" """
Adds a NIO as new port on Frame Relay switch. Adds a NIO as new port on Frame Relay switch.
:param nio: NIO object to add :param nio: NIO instance to add
:param port: port to allocate for the NIO :param port: port to allocate for the NIO
""" """

View File

@ -31,7 +31,7 @@ class Hub(Bridge):
""" """
Dynamips hub (based on Bridge) Dynamips hub (based on Bridge)
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param name: name for this hub :param name: name for this hub
""" """
@ -102,7 +102,7 @@ class Hub(Bridge):
""" """
Adds a NIO as new port on this hub. Adds a NIO as new port on this hub.
:param nio: NIO object to add :param nio: NIO instance to add
:param port: port to allocate for the NIO :param port: port to allocate for the NIO
""" """

View File

@ -34,7 +34,7 @@ class Router(object):
""" """
Dynamips router implementation. Dynamips router implementation.
:param hypervisor: Dynamips hypervisor object :param hypervisor: Dynamips hypervisor instance
:param name: name for this router :param name: name for this router
:param platform: c7200, c3745, c3725, c3600, c2691, c2600 or c1700 :param platform: c7200, c3745, c3725, c3600, c2691, c2600 or c1700
:param ghost_flag: used when creating a ghost IOS. :param ghost_flag: used when creating a ghost IOS.
@ -221,7 +221,7 @@ class Router(object):
""" """
Returns the current hypervisor. Returns the current hypervisor.
:returns: hypervisor object :returns: hypervisor instance
""" """
return self._hypervisor return self._hypervisor
@ -1102,7 +1102,7 @@ class Router(object):
Adds a slot binding (a module into a slot). Adds a slot binding (a module into a slot).
:param slot_id: slot ID :param slot_id: slot ID
:param adapter: device to add in the corresponding slot (object) :param adapter: device to add in the corresponding slot
""" """
try: try:
@ -1186,7 +1186,7 @@ class Router(object):
Installs a WIC adapter into this router. Installs a WIC adapter into this router.
:param wic_slot_id: WIC slot ID :param wic_slot_id: WIC slot ID
:param wic: WIC to be install (object) :param wic: WIC to be installed
""" """
# WICs are always installed on adapters in slot 0 # WICs are always installed on adapters in slot 0
@ -1271,7 +1271,7 @@ class Router(object):
:param slot_id: slot ID :param slot_id: slot ID
:param port_id: port ID :param port_id: port ID
:param nio: NIO to add to the slot/port (object) :param nio: NIO instance to add to the slot/port
""" """
try: try:
@ -1304,7 +1304,7 @@ class Router(object):
:param slot_id: slot ID :param slot_id: slot ID
:param port_id: port ID :param port_id: port ID
:returns: removed NIO object :returns: removed NIO instance
""" """
try: try: