Goal

This tutorial shows how your application can discover the onePK service sets that are available on a network element.

Tutorial Code

The code used in this tutorial is available in <SDK Location>/python/tutorials/discovery/DiscoveringOnePKServiceSetsTutorial.py.

Requirements/Prerequisites

To connect to a network element, your application needs to have the following information available:

  • Network element hostname/IP address.
  • Application authentication credentials, that is, username and password.

    See the Connecting to a Network Element tutorial.

Steps In Detail

Service Set Description List

Discovering which onePK optional service sets are available on a network element is quite simple. You ask the connected network element for a list of available service sets. The network element returns a list that you can use to find the readable name and version of the optional service set.

sdList = tutorial.get_network_element().discover_service_set_list()
if sdList == None or len(sdList) == 0:
    logger.info("Empty Service Set Description list")
else:
    for sd in sdList:
        logger.info("NetworkElement IPAddress = %s ", sd.network_element.host_address)
        services = sd.service_set_list
        if services != None:
            for serviceName in services:
                logger.info("Service Name: %s ", ServiceSetDescription.ServiceSetName.enumval(serviceName) )
                logger.info("Versions: %s", services.get(serviceName))

Result

Congratulations! Now you can discover the available onePK service sets on the connected network element.