This tutorial shows how your application can discover the onePK service sets that are available on a network element.
The code used in this tutorial is available in <SDK Location>/python/tutorials/discovery/DiscoveringOnePKServiceSetsTutorial.py.
To connect to a network element, your application needs to have the following information available:
See the Connecting to a Network Element tutorial.
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))
Congratulations! Now you can discover the available onePK service sets on the connected network element.