Introduction

Introduction

Welcome to the sysrepo plugin development documentation page. This page serves as the starting point for developing sysrepo plugins. Here you can find a simple tutorial on building your initial plugin, documentation for existing plugins, interesting examples which might help you resolve issues etc.

This introduction page contains references to main components needed for building sysrepo plugins

About sysrepo and libyang

Sysrepo

Sysrepo is a YANG-based configuration and operational state data store for Unix/Linux applications.

Applications can use sysrepo to store their configuration modeled by provided YANG model instead of using e.g. flat configuration files. Sysrepo will ensure data consistency of the data stored in the datastore and enforce data constraints defined by YANG model. Applications can currently use C language API of sysrepo Client Library to access the configuration in the datastore, but the support for other programming languages is planed for later, too.

Doxygen documentation (opens in a new tab).

Libyang

libyang is a library implementing processing of the YANG schemas and data modeled by the YANG language. The library is implemented in C for GNU/Linux and provides C API.

Doxygen documentation (opens in a new tab).

Plugin development

Sysrepo allows the writing of plugins which can be used to store data using sysrepo's datastores (startup, running, operational etc.) and also reacting to changes in the datastore (subscriptions).

For a simple overview of the sysrepo plugin development - simple plugin example (opens in a new tab).

Currently written plugins for Telekom:

This repository provides an explanation to how these plugins are created and it follows the system-plugin code design and organization.

A step by step documentation is provided in the development/ folder. The documentation starts off with setting up the development environment and after that provides an overview of the plugin code structure.

This page contains multiple sections intended for different use cases. Here is an overview of the current folders used in this repository and their intended use case:

  • overview/ - contains an introduction to the plugin development, breif overview of sysrepo and libyang and more information which can be used for a quick introduction to sysrepo plugin development
  • tutorial/ - step by step tutorial for a first time plugin developer; contains info about setting up the preferred IDE and a simple C plugin tutorial - writing plugin init and cleanup callbacks and also module change, operational and RPC callbacks and subscribing to particular events using these callbacks
  • development/ - once comfortable with the plugin development process, you can read this section of the repository for better understanding of the currently developed plugins using a specific code structure which is intended for readability and a team of developers - each member should be able to work on unique features of the plugin without the possibility of merge conflicts