Join DevNet Get your $49 DevNet Explorer Pass

YANG Development Kit Model-driven APIs for simplified programmability of your network device


Download YDK-Py

What is YDK?


We have created the YANG Development Kit (YDK) to facilitate network programmability using data models. YDK can generate APIs in a variety of programming languages using YANG models. These APIs can then be used to simplify the implementation of applications for network automation. YDK has two main components: an API generator (YDK-gen) and a set of generated APIs. Today, YDK-gen takes YANG models as input and produces Python APIs (YDK-Py) that mirror the structure of the models.

Read more....

Why YDK?

Any Model

Wide support for YANG data models (open or native)

Any Transport

Support for NETCONF and RESTCONF while extensible to other protocols

Any Language

Support for Python and C++ APIs while extensible to other programming languages

Open

APIs and their generator distributed as open source

A YDK Hello World!


        # import providers, services and models 
        from ydk.services import CRUDService
        from ydk.providers import NetconfServiceProvider
        from ydk.models.cisco_ios_xr import Cisco_IOS_XR_shellutil_oper \
            as xr_shellutil_oper
        from datetime import timedelta
        
        if __name__ == "__main__":
            """Main execution path"""
            
            # create NETCONF session
            provider = NetconfServiceProvider(address="10.0.0.1",
                                              port=830,
                                              username="admin",
                                              password="admin",
                                              protocol="ssh")
            # create CRUD service
            crud = CRUDService()
            
            # create system time object
            system_time = xr_shellutil_oper.SystemTime()
           
            # read system time from device
            system_time = crud.read(provider, system_time)
            
            # Print system time
            print("System uptime is " + 
                  str(timedelta(seconds=system_time.uptime.uptime)))
            
            # close NETCONFIG session and exit
            provider.close()
            exit()           
  

More examples in GitHub

Communities View All >

CMake Error CMP0048

Created by: Hariharan Ananthakrishnan

From: "Santiago Alvarez (saalvare)" <saalvare@cisco.com>
Date: Friday, 13 October 2017 at 15:25
To: Hariharan Ananthakrishnan <hari@packetdesign.com>, "Abhi Ramesh Keshav (abhirame)" <abhirame@cisco.com>
Cc: "Santiago...

Created: Oct 14 2017

Last modified: Oct 28 2017

Replies: 1

Tags: 0

ydk-cpp: openconfig interfaces issues

Created by: Hariharan Ananthakrishnan

Hi,   I am geting segfault when doing a read query for interfaces using ydk_openconfig 1.4.1.  IOS-XRv is 6.1.2 version.   [root@nclinux ydk]# rpm -qa | grep ydk libydk-0.6.1-1.x86_64 libydk-ietf-0.1.3-1.x86_64...

Created: Oct 25 2017

Last modified: Oct 25 2017

Replies: 2

Tags: 0

ydk-cpp: async support for restconf/netconf clients

Created by: Hariharan Ananthakrishnan

Is there any plan to support non-blocking/async calls for restconf/netconf client functions ? Currently I see they use blocking calls i.e. restconf_client using curl_perform_easy() and netconf_ssh_client using from libnetconf.   In a singled...

Created: Oct 25 2017

Last modified: Oct 25 2017

Replies: 0

Tags: 0

ydk-cpp: IETF interfaces issues

Created by: Hariharan Ananthakrishnan

Getting the following error if I try to read IETF interface model. IOS-XR 6.1.2.   [root@nclinux ydk]# rpm -qa | grep ydk libydk-0.6.1-1.x86_64 libydk-ietf-0.1.3-1.x86_64 libydk-openconfig-0.1.4-1.x86_64   [root@nclinux ydk]# ./a.out...

Created: Oct 25 2017

Last modified: Oct 25 2017

Replies: 7

Tags: 0

Vagrant sandbox updated with release 0.6.0

Created by: Santiago Alvarez

We announced YDK-Py 0.6.0 a month ago.  You can now give it a try using the Vagrant sandbox available in the ydk-py-samples repo.  What exactly is installed?   ...

Created: Sep 07 2017

Last modified: Oct 25 2017

Replies: 3

Tags: ios-xr, netconf, python, ios-xe, vagrant, yang, ydk