Nokia SR Linux makes extensive use of structured data models. Each application, whether provided by Nokia or written by a user against the NDK, has a YANG model that defines its configuration and state.
With this design, the YANG data model is defined first, then the CLI, APIs, and show output formats are derived from it.
This repository contains only the source YANG files that one can use to build code bindings or explore the way the modules are built. To browse the modules, we recommend using yang.srlinux.dev portal, which provides human-friendly tools to browse and search through the models.
The main branch of this repository contains only the documentation. To see the yang files for a given release, select the tag that matches the SR Linux release version.
For instance, the v21.6.2
tag corresponds to the SR Linux release 21.6.2.
There are several ways to download the yang files for a specific SR Linux release. The below examples are provided for the v21.6.2
version.
Clone the yang files for a specific release with the following git
command:
git clone -b v21.6.2 --depth 1 https://github.com/nokia/srlinux-yang-models
To download the proto files for a specific release in the zip
or tgz
archive, navigate to the GitHub tag
page, which contains the links to the archives.
If needed, the download link can be programmatically derived using the following rule:
for zip
https://github.com/nokia/srlinux-yang-models/archive/tags/
+ $tag
+ .zip
for tar.gz
https://github.com/nokia/srlinux-yang-models/archive/tags/
+ $tag
+ .tar.gz
To extract YANG modules of each SR Linux release and put them in a single directory, use the provided get-all-modules.sh
script:
# extracts modules in the `$(pwd)/all` directory
./get-all-modules.sh