-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update py_gnmicli.py for gNMI Subscribe support #65
base: master
Are you sure you want to change the base?
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 83 Continue 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix line length.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line length
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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line length
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
@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.