For questions, read the onePK Forums

Contents

How to Use These Tutorials

This page provides links to the onePK tutorials for the Python programming language. The starting point is Connecting to a Network Element, which you need to use for all other Python tutorials. Once you have connected to a network element, you can explore the other tutorials in the series. The tutorials are organized under Base and Extension Service Sets. Base Service Sets are available on all platforms; Extension Service Sets are available on limited platforms; in SDK v1.0.1 none are available for Python. Service Sets may have multiple tutorials, which are designed to demonstrate different aspects of their functionality.

Audience

The tutorials are intended for developers who are using onePK APIs to connect to a network element or device and manage and interact with the network administration programmatically. To get the most out of these tutorials, you are expected to have a good working knowledge of Python. For more information about developing with onePK APIs, see the Design Guide and API Reference documentation.

The Code

The tutorial code and instruction files are included in the onePK Python SDK. See <SDK location>/python/tutorials/src. Try out code from each of the tutorials by compiling and running it. You can find the code located in each of the folders under <SDK Location>/python/tutorials/src/.

Network Element Configuration

To configure the Network Element for these tutorials, use the following commands:

router(config)#onep
router(config-onep)#transport tls

Connecting to a Network Element Tutorial

Connecting to a Network Element This tutorial shows how to create an authorized session to a network element from a onePK-enabled application. Connecting to a network element is required by all onePK-enabled applications.

Base Service Set Tutorials

Base Service Sets are available on all platforms.

  • Element Service Set
    Session Handling Configuring the parameters of connections and how to use session information.
    Element Getting basic network element functionality such as system attributes, plus license, process, and Field Replaceable Unit (FRU) list and attributes.
    Network Interface Accessing interface properties and events, including for interface addresses, status, and statistics. Also creating and registering a CDP events listener.
    Events Registering for callback notifications when system events occur, such as syslog, or CLI events.
  • Discovery Service Set
    Discovery Discovering onePK services and topologies.
  • Utility Service Set
    Application CLI Extension Adding commands to the network element's command-line-based management interface (CLI), which can then be used to configure the application from the network element.
    AAA Using AAA to authenticate a user, to read the user's authorization attributes configured on the AAA server, and to send accounting requests to the AAA server.
    VTY Opening a virtual terminal (VTY) on the connected network element and interacting with it to facilitate communication between onePK applications and the network element.
  • Policy Service Set
    Policy Creating and applying ACL and QoS policies to the network element.
  • Routing Service Set
    Routing Reading RIB routes, updating application routes, and adding listeners for route up/down events in the RIB.
  • Location Service Set
    Location Adding, removing geo, civic and custom location information and adding listeners for location change events.
  • Identity Service Set
    Identity Adding Identity sessions, updating sessions, fetching session attributes and deleting the sessions.