OcNOS-SP : Data Model Reference : 2. Get the datamodels
2. Get the datamodels
The datamodels can be retrieved in the following locations:
github
OcNOS installed device
2.1 Datamodel Location in Github
This link takes you to the ‘master’ branch. But please note that this is not the latest one and it is not up to date. So change the ‘branch’.
Click on ‘master’
From dropdown, enter search string such as“5.1” , “6.0.0”, “6.3.0” based on the OcNOS release version you need the yang models for.
Select from dropdown and click to switch the branch.
C:\13bb9e617bb0cebd11552e7e59c2ff29
The Yang modules are available inside the “yang-files” folder.
2.1.1 Yang Datamodels
The Yang models are available inside the “yang-files” folder.
There are 2 types of Datamodels that OcNOS supports
1. IPI Datamodels
2. OpenConfig datamodels
C:\c203d7245a57ee0ed6290ca94028e1b8
2.1.2 IPI Datamodels
The IPI Datamodels are the ‘native’ datamodels which OcNOS supports. All configurations and operational attributes of OcNOS are modelled using this datamodel. This datamodel follows OpenConfig style guidelines with clear segregation of ‘config’ and ‘state’ attributes. Its inside yang-files/ipi folder in github.
C:\409583512477f7800243fe2f42cc9c20
2.1.2.1 IPI Pyang Tree
In order to access the Pyang Trees follow the steps.
1. Go to the bottom of the page and click on pyang.html.
2. On pyang page, right-click on ‘view raw’ and select ‘Save link as ..’ Don’t select Download.
C:\8bd942e22803c6f8b54cdd1a1bee8adf
3. After ‘Save link as ..’ the pyang html page will be saved and you can view the Pyang tree. Once the page opens, scroll down and you can see the individual datamodel pyang trees.
C:\ca843abe1a2798a0cd6459435e0d51e0
2.1.3 OpenConfig Datamodels
For OpenConfig datamodels we need to combine IPI deviation files with OpenConfig yang files:
C:\b6b18cd1c32297370eb0444512ab2fc2
From IPInfusion GitHub, get the deviation files from “yang-files/openconfig”
In this folder there is also a README file containing the OpenConfig SHA1 to be used (TBD)
Earlier OpenConfig did not have release versioning, so you need to get the files using git:
git clone git@github.com:openconfig/public.git openconfig/
git checkout <SHA1 from README>
cd openconfig/release/models
Note: OpenConfig has now added versioning support. Future releases of OcNOS will be aligned to OpenConfig released versions.
After git checkout, the yang files will be in openconfig/release/models folder.
Not all attributes of the OpenConfig datamodels are supported. Also there are few variations in the ones that are supported. These are tabulated in the ‘yang deviation’ files inside the “yang-files/openconfig” folder.
2.1.3.1 OpenConfig Pyang Tree
The Pyang Tree of OpenConfig is also available in the github under yang-files/openconfig/openconfig.html.
Follow same instructions given in 2.1.2.1 IPI Pyang Tree to download the html file and then open it.
This gives the consolidated view of OpenConfig support in OcNOS including only the attributes that's supported as well incorporating the deviations.
C:\34ffd513551c7f477cc26079156259ed
2.2 Datamodel Location in device
All the yang models are loaded in the OcNOS device and after OcNOS is installed, they can be found in this location.
OcNOS#start-shell
bash-5.0$ cd /usr/share/yuma/modules
bash-5.0$ ls
ipi netconfcentral openconfig yang
bash-5.0$ find . | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
.
|-ipi
tfo
ipi-tfo.yang
ipi-tfo-types.yang
network-instance
ipi-network-instance.yang
ipi-network-instance-types.yang
common
.....
Last modified date: 07/13/2023