Update py_gnmicli.py for gNMI Subscribe support#65
Update py_gnmicli.py for gNMI Subscribe support#65tejaskumark wants to merge 7 commits intogoogle:masterfrom
Conversation
Adding support for gNMI subscribe.
Codecov Report
@@ Coverage Diff @@
## master #65 +/- ##
=======================================
Coverage 52.79% 52.79%
=======================================
Files 10 10
Lines 1197 1197
=======================================
Hits 632 632
Misses 482 482
Partials 83 83Continue to review full report at Codecov.
|
|
@mike-albano Can you please help to get this merge, this has fix for xpath construction with (- and /) and also subscribe request. Thanks. |
mike-albano
left a comment
There was a problem hiding this comment.
Thanks for putting this together. Looking forward to giving it a shot.
Can you up the version, and resolve the branch conflicts?
gnmi_cli_py/py_gnmicli.py
Outdated
| gNMI SubscribeRequest object. | ||
| """ | ||
| mysubs = [] | ||
| mysub = gnmi_pb2.Subscription(path=paths, mode=opt["submode"], sample_interval=opt["interval"]*1000000000, heartbeat_interval=opt['heartbeat']*1000000000, suppress_redundant=opt['suppress']) |
gnmi_cli_py/py_gnmicli.py
Outdated
| myqos = gnmi_pb2.QOSMarking(marking=opt["qos"]) | ||
| else: | ||
| myqos = None | ||
| mysblist = gnmi_pb2.SubscriptionList(prefix=myprefix, mode=opt['subscribe_mode'], allow_aggregation=opt['aggregate'], encoding=opt['encoding'], subscription=mysubs, use_aliases=opt['use_alias'], qos=myqos) |
gnmi_cli_py/py_gnmicli.py
Outdated
| if response.HasField('sync_response'): | ||
| print('Sync Response received\n'+str(response)) | ||
| elif response.HasField('error'): | ||
| print('gNMI Error '+str(response.error.code)+' received\n'+str(response.error.message) + str(response.error)) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #65 +/- ##
==========================================
+ Coverage 52.32% 52.44% +0.11%
==========================================
Files 10 12 +2
Lines 1204 1249 +45
==========================================
+ Hits 630 655 +25
- Misses 491 510 +19
- Partials 83 84 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@mike-albano Changes done. Please review. Thanks. |
- Version updated. - Updated info section.
|
@mike-albano Just to make sure this is not missed. |
- Adding support for subscribe mode. The code is mostly based on this patch: google#65 - Adding a new parameter to limit the number of updates, e.g. after a number of streaming updates the client would stop listening. It is convenient for testing purposes. - Changing the sample interval unit to millisecond. This is also required for testing cases. Co-authored-by: Murat Acikgoz <muacikgo@microsoft.com>
Adding support for gNMI subscribe.