cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Sample apps for encoding LLDP using OpenConfig

deom
Cisco Employee
Cisco Employee

Image result for ydk

Hello again,

 

I have brought another set of sample apps for ydk-py. 

This set of sample apps allow you to encode the LLDP configuration to XML. 

 

cd-encode-oc-lldp-10-ydk.py - encode boilerplate
cd-encode-oc-lldp-20-ydk.py - enable LLDP
cd-encode-oc-lldp-22-ydk.py - enable LLDP with timer
cd-encode-oc-lldp-24-ydk.py - enable LLDP with TLV adv

 

 

You can also find the samples in the following folder of the github repository:

https://github.com/CiscoDevNet/ydk-py-samples/tree/master/samples/basic/codec/models/openconfig/openconfig-lldp

 

With this set of samples, you don't need to access to server to encode the configuration.

Also, you can easily modify the code to encode the configuration in JSON by adjusting the parameter of the code like this:

 

provider = CodecServiceProvider(type="xml")

to

provider = CodecServiceProvider(type="json")

 

 

Give it a try :D

 

 

0 REPLIES 0
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: