Home | Trees | Indices | Help |
|
---|
|
The NetworkElement class represents the hardware that hosts the network OS.
It provides network services to a oneP application. The class provides access to the network services offered by network element through a session The session is managed by the class. Each application can have one and only one session to a network element, however an application may connect to as many network elements as it can maintain connections to.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
Class Variables | |
cpu_sampling_interval = property(_get_cpu_sampling_interval, _
|
|
OnepSessionState = enum('ONEP_STATE_DISCONNECTED', 'ONEP_STATE
|
|
OnepSyslogSeverity = enum('ONEP_SYSLOG_EMERGENCY', 'ONEP_SYSLO
|
|
log = None
|
Instance Variables | |
parent The NetworkApplication instance that created this class. |
|
appl_managed_data The application managed data. |
|
str
|
appname Name of the oneP application. |
float
|
connect_time The time when connection established to the Network Element. |
str
|
disconnect_msg The message sent to Network Element while disconnecting. |
float
|
disconnect_time The time when disconnected from the Network Element. |
str
|
host_address The host IP address. |
dict
|
interfaces All the network interfaces in dictionary form. |
str
|
password Password used for the session authentication. |
int
|
port The port to connect to. |
ElementProperty |
properties Provides the static properties of the NetworkElement. |
SessionHandle |
session_handle A numeric ID associated with the session. |
OnepSessionState
|
state The current state of the session. |
str
|
username Username used for the session authentication. |
Properties | |
Inherited from |
Method Details |
Constructor of NetworkElement
|
Licensing of Network Element - [PID of the license identifiers : Version ID : Serial number]
|
Add a logical interface to network element. Raises OnepInterfaceException
Keyword argument: if_id -- int - Logical interface number, subintf_id if it is subinterface type -- enum - NetworkInterface.InterfaceTypes parent_intf --NetworkInterface-- base interface |
Remove a logical interface to network element. Raises OnepInterfaceException
Keyword argument: if_obj - interface class |
Sets a connection listener. Registers a connection state change listener callback for the connect/disconnect state change event.
|
Adds an Interface up/down state listener to the NetworkElement object.
|
Removes the interface event listener. This method removes the listener associated with the specified eventHandle and also removes the corresponding registered event on the NetworkElement.
|
Adds a syslog listener to the NetworkElement object. Multiple listeners can be associated with an instance of NetworkElement.
|
Removes the Syslog event listener This method removes the listener associated with the specified eventHandle and also removes the corresponding registered event on the NetworkElement
|
Adds an Online Insertion and Removal(OIR) listener Multiple listeners can be associated with an instance of NetworkElement.
|
Removes the Online Insertion and Removal(OIR) event listener. This method removes the listener associated with the specified eventHandle and also removes the corresponding registered event on the NetworkElement.
|
Adds a CLI listener to the NetworkElement object Multiple listeners can be associated with an instance of NetworkElement
|
Removes the CLI event listener. This method will remove the listener associated with the specified eventHandle and also remove thecorresponding registered event on the NetworkElement.
|
Adds a (Cisco Discovery Protocol) CDP listener Multiple listeners can be associated with an instance of NetworkElement. The event is generated when changes in the CDP table match specified filter criteria on the network element.
|
Removes the CDP event listener. This method will remove the listener associated with the specified event_handle and also remove the corresponding registered event on the NetworkElement.
|
Adds an Interface Address Change listener Multiple listeners can be associated with an instance of NetworkElement.
|
Removes the Interface Address Change event listener. This method removes the listener associated with the specified eventHandle and also removes the corresponding registered event on the NetworkElement.
|
Adds an Interface Create/Delete event listener Multiple listeners can be associated with an instance of NetworkElement.
|
Removes the Interface Create/Delete event listener This method removes the listener associated with the specified event_handle and also removes the corresponding registered event on the NetworkElement.
|
Adds a MTU change listener to the network interface.
|
Removes the MTU event listener. This method will remove the listener associated with the given event_handle.
|
Adds a Bandwidth change listener to the network interface.
|
Removes the Bandwidth event listener. This method will remove the listener associated with the given event_handle.
|
Adds a VRF change listener to the network interface.
|
Adds an application listener to the NetworkElement object Multiple listeners can be associated with an instance of NetworkElement. The application-specific event allows applications to publish application-specific events. If an application is registered for the event type, it receives a callback notification when the specified event is published and also matches the specified filter.
|
Removes the application event listener This method removes the listener associated with the specified eventHandle and also removes the corresponding registered event on the NetworkElement.
|
Publishes an application event to the abstraction layer This method publishes an application event to the abstraction layer.
|
Reconnects to the disconnected session. Provides the ability to reconnect back to the network element after the session is disconnected by the application via the disconnect method, or abnormally due to connection failure. If the application has specified the reconnect timer during the connect attempt to the network element, it can reconnect to the original session if reconnection is made within the reconnect timeout window, if the sessionId is the same as the original session, and if the reauthentication is successful. With successful reconnection, the same SessionHandle is returned. If any failure occurs during the reconnection attempt, NULL SessionHandle is returned along with the exception detailing the reason. If the reconnect timer expires and no reconnection attempt is successfully made to the network element, the session resource in the network element is released. null SessionHandle is returned in the following cases:
|
Connects to the network element using default session configuration. This method provides the ability to connect to the network element, if it is not currently connected. With successful connection and authentication to the network element, a SessionHandle is returned. If any failure occurs during the connection attempt, an exception detailing the reason will be raised. The default SessionConfig is used during establishment of the connection. Authentication is required in order to access the NetworkElement. Password authentication is used. The username and password needs to be configured in the network element and to be authenticated using network element configured authentication mechanism (that is, locally, RADIUS, and TACACS+) Note: Each network element has a configurable session limit that allows the rate limit on accessing the network element. This limit is configurable via CLI (session maximum) in the network element. The range is 1 to100. Default maximum session is 10.
|
Connects to the network element with the specified session configuration. This method is deprecated and replaced by connect This method provides the ability to connect to the network element, if it is not currently connected. With successful connection and authentication to the network element, a SessionHandle is returned. If any failure occurs during the connecting attempt, NULL SessionHandle is returned along with the exception detailing the reason. The default SessionConfig is used during connection establishment. Authentication is required in order to access the NetworkElement. Password authentication is used. The username and password needs to be configured in the network element and to be authenticated using network element configured authentication mechanism (i.e. locally, RADIUS, and TACACS+) Note. Optionally, application can set a reconnect timer in seconds via SessionConfig class. The timer is used in the network element side to keep the session information intact upon detection of application is unreachable (that is link is down or disconnected). If application is able to reconnect to the network element within the timeout window, the existing session context will be restored and used. If no reconnect timer is specified, the existing session information on the network element is released upon detection of unreachable of application. If application uses connect method to network element where the exited session still have reconnect timer running, the timer will be canceled. A new session establishment will be attempted.
|
Disonnect from a network element This method provides the ability to disconnect from the network element if the application is currently connected. When the application finishes the session, the session can be disconnected. This allows the network element resources to be freed on the network element, if no optional reconnect timer has been specified during the connect.
|
Gets the interfaces collection in dictionary form
|
Gets the list of interfaces
|
Gets the NetworkInterface instance by the giving display name. This method returns a NetworkInterface instance on the specified NetworkElement by the giving display name. The name should be in the long display name format, for example, "Ethernet0/1".
|
Returns a list of ProcessIDL class. Gets the list of active processes in the NetworkElement and their respective CPU utilization and memory usage. The application can specify the time period for which it wants to retrieve the CPU utilization by setting the sampling interval. If the application does not set the sampling interval, the getProcessList() method retrieves CPU utilization for the most recent time period. However, if the application does set the sampling interval but the interval does not match any of the time period values supported by the platform, then the CPU utilization is retrieved for the most recent time period which is closest to the sampling interval. For example, if the Network Element supports CPU utilization for time periods 5 seconds, 60 seconds and 300 seconds, and the application sets the sampling interval as 100seconds, then the CPU utilization returned will be for the most recent time period closest to 100 seconds, which is 60 seconds. If there is an error in receiving the cpu usage value, it will be set to -1.
|
Gets the total system memory in bytes.
|
Gets the total system memory in bytes.
|
Gets the free system memory in bytes.
|
Gets the free system memory in bytes.
|
Gets the total CPU utilization in percentage. The time period for which the CPU utilization is retrieved is determined by the sampling interval set through the {@link #setCPUSamplingInterval(int)} method. If no sampling interval is set, the CPU utilization is retrieved for the most recent time period supported by the platform. However, if the application does set the sampling interval, but interval does not match any of the time periods supported by the platform, the CPU utilization returned is for the most recent time period closest to the sampling interval.
|
Gets the total CPU utilization in percentage. The time period for which the CPU utilization is retrieved is determined by the sampling interval set through the {@link #setCPUSamplingInterval(int)} method. If no sampling interval is set, the CPU utilization is retrieved for the most recent time period supported by the platform. However, if the application does set the sampling interval, but interval does not match any of the time periods supported by the platform, the CPU utilization returned is for the most recent time period closest to the sampling interval.
|
Discovers services available on the root network element and also on its neighbors that support onePK services. The application has to be connected to the root network element to initiate service discovery. The discover_service_set_list method returns a list of ServiceSetDescription containing the information on the service set that is available on the root network element and its neighbors. In cases where onePK-supported discovery protocol is not enabled on the root element, the discover_service_set_list API returns service information only for the root element. The onePK application can use the information returned by ServiceSetDescription to identify the network elements that support a given set of services, and initiate connection to those elements and invoke the service set APIs. The following sample code shows on how to obtain information on the services supported by the root NetworkElement and its neighbors: >>> sdList = elem.discover_service_set_list() >>> for sd in sdList: #get network element ne = sd.network_element #get the services available on this Network Element #Service Set name is the key, value is the string #containing the enabled Service set version services = sd.service_set_list #Connect to the Neighboring 1P network element, which supports #1.0 version of ONEP_BASE_SERVICE_SET
|
Adds a Service Set Discovery listener to the NetworkElement object. The application can add a Service Discovery listener to receive service set state change notifications from the Network Element to which it is directly connected (the root Network Element) and its neighbors. The application can also define filter criteria based on Network Element, service set name, and service set state. The application can use the notification received to either invoke the APIs of the enabled service sets, or cleanup the resources for the disabled service sets. Multiple listeners can be associated with an instance of NetworkElement. Note: The application will not receive notifications for Base service set changes for Local discovery type. If the Base service set is disabled on the root network element, the application will receive connection notification if the application has registered for connection notification. For remote discovery, the application will receive notification on Base Service set state changes provided the application has registered for these change notifications.
|
Removes the given discovery listener.
|
Gets a string representation of the NetworkElement. The toString method for the class NetworkElement returns the string representation of the NetworkElement object instance and the element properties.
|
Gets a Location object associated with the network element. The Location object can be used to access all types of location information.
|
Sets location information for the network element. Sets location information for the network element with the information in the input Location parameter.
|
Returns the collection of the Field Replaceable Unit (FRU)
|
Creates a syslog message on the network element Creates a syslog message on the network element of specified:
|
This method installs an Application Management Data XSD (ClI extension) on the network element.
|
This method uninstalls a ClI extension on the specified network element.
|
This method queries for a ClI extension on the specified network element.
|
Class Variable Details |
cpu_sampling_interval
|
OnepSessionState
|
OnepSyslogSeverity
|
Instance Variable Details |
parentThe NetworkApplication instance that created this class. If the class was created using the constructor of this class, not the NetworkApplication class, this variable will be set to None. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Aug 18 09:17:28 2014 | http://epydoc.sourceforge.net |