This is an gNMI Adapter NSO Python package. This package adds gNMI support to NSO.
It contains a YANG data model which implements the configuration (port, security).
You will also need sources from https://github.com/ConfD-Developer/gnmi-tools
linked into the python
directory.
Tip
|
cd python; ln -s ../../gnmi-tools/src/*.py .; cd ..
|
Following elements can be configured (nso-gnmi-tools.yang
).
-
nso-gnmi-tools/port
- the port the gNMI server listens on -
nso-gnmi-tools/tls/enabled
- if TLS is enabled -
nso-gnmi-tools/tls/keyFile
- server key file (must be configured if TLS is enabled) -
nso-gnmi-tools/tls/certFile
- certificate file (must be configured if TLS is enabled)
Note
|
Example how to create server key and certificate file, see gnmi-tools sources, file make-keys.sh .
|
Create NSO run dir
ncs-project create nso-gnmi`
and link this package to packages
folder, e.g.
cd packages; ln -s ../../nso-gnmi-tools/; cd ..`
Note
|
Optionally, copy server keys and certificate file to this directory. |
start nso ncs
or ncs --package-with-reload
When NSO is started, the gNMI server is started as well.
When nso-gnmi-tools
configuration is changed, the gNMI server is restarted with the new configuration.
Use gNMI client (e.g. one present in gnmi-tools
) to invoke gNMI operations
against config and state data in NSO.
E.g.:
./src/confd_gnmi_client.py --insecure -o capabilities ./src/confd_gnmi_client.py --insecure -o get --path /python-vm ./src/confd_gnmi_client.py --insecure -o subscribe -s POLL --poll-count=100 --path /python-vm --allow-aggregation