Open renukamanavalan opened 2 years ago
Hey @renukamanavalan , Can you please provide a bit more details:
Wow! Out of words! Never expected such a quick response.
Here are the details.
1) There is a opensource project called SONiC.
2) The main firmware/os-image is buildimage
3) One of the submodules the OS uses is sonic-gnmi
4) This submodule runs a gNMI server that can be reached via gnmi_cli (a GO based tool) as below.
gnmi_cli -client_types=gnmi -a 127.0.0.1:50051 -t EVENTS -logtostderr -insecure -v 7 -streaming_type ON_CHANGE -q all[heartbeat=5] -qt s
5) One of the use cases we have, the internal host processes publishes events. A gnmi client connection to telemetry can be used to receive those events. Generally external tools connect to receive the events.
I am writing a test script that publishes few events and would like to receive the same via gnmi Query to help test end to end. My script is in python, so if I can write a python code to subscribe to gNMI server and receive the events, it will help.
I installed pygnmi. I have attached the entire o/p of pip freeze. I just tried the steps above, to test it first, from inside the host. BTW, running the gnmi_cli (mentioned above) works fine inside the host.
admin@str-s6000-on-5:~$ sudo pip freeze | grep -i gnmi
gnmi==0.0.0a0
gnmi-py==0.7.1
pygnmi==0.8.9
admin@str-s6000-on-5:~$
Any help from you would be great
THANK YOU!
Versions installed:
My trial: I just created client and tried a subscribe onchange stream request. The.subscribe fails with following:
AttributeError: 'gNMIclient' object has no attribute '_gNMIclient__channel'
Details below. Any tips would be pretty helpful.