Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.
Abhi Keshav edited this page Mar 15, 2016 · 2 revisions

ydk-py

YDK python model API can be used to program a remote server. Making use of the python model API, an application can be written by choosing one or more APIs. The python entities created by the model API's are passed to a Service instance which enables the user to read to and write from a remote server.

A ServiceProvider implementation is provided to implement the encoding and transport to and from the remote device. NetconfServiceProvider is the currently supported implementation of ServiceProvider. This provides the mechanism to establish a connection to the remote server. Internally, the ServiceProvider uses an Encoder which encodes the python entities into the protocol format (for netconf, the encoded protocol format is XML). The Encoder also performs validation of the python entities (based on the underlying YANG model). If any errors are detected during validation, the errors are reported and the application exits. The product of the encoding is referred to as the payload.

Once the payload is validated and ready, it is passed to a ServiceProviderPlugin (which is a wrapper around the ncclient library). The ServiceProviderPlugin delivers the payload to the server and outputs the reply from the server. The raw encoded reply from the server is then decoded to bind it to python object. The output is also directly printed to the command line shell from which ydk is being run.

The above diagram gives a broad overview of ydk-py.

Clone this wiki locally