Package onep :: Package topology :: Module Node :: Class Node
[frames] | no frames]

Class Node


Node class represents topology node discovered via a protocol by connecting to a NetworkElement. A Node object can contain the identity of a network node like hostname, IP address etc, depending how the node was discovered. For example, if the node is discovered via CDP, then the Node object contains hostname, IP address; if the node is discovered through OSPF or any other L3 routing protocol, then the Node object contains only the IP address.

Instance Methods
 
__init__(self, name, type, address_list)
x.__init__(...) initializes x; see help(type(x)) for signature
 
equals(self, obj)
Compare two nodes for equality.
 
__str__(self)
str(x)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables
  NodeType = enum('CDP_NODE', 'MEDIA_TRACE_NODE', 'INVALID_NODE_...
The type of node discovered by a protocol
  name = property(_get_name, None, _doc)
  type = property(_get_type, None, _doc)
  address_list = property(_get_address_list, None, _doc)
Properties

Inherited from object: __class__

Method Details

__init__(self, name, type, address_list)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Raises:
Overrides: object.__init__

equals(self, obj)

 

Compare two nodes for equality. This method returns true if the two topology nodes are equal and the same. For CDP nodes the hostname and the management IP address of the node are compared.

Parameters:
  • obj - The other Node object to compare with.
Returns:
Returns true if the two topology nodes are equal and the same.

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

Class Variable Details

NodeType

The type of node discovered by a protocol

Value:
enum('CDP_NODE', 'MEDIA_TRACE_NODE', 'INVALID_NODE_TYPE')