HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

gnmic subscribe — Subscribe to a gnmic network device state updates. More information: <https://gnmic.openconfig.net/c

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandgnmicgnmic subscribenetworksubscribeclistatedevice

Problem

How to use the gnmic subscribe command: Subscribe to a gnmic network device state updates. More information: <https://gnmic.openconfig.net/cmd/subscribe/>.

Solution

gnmic subscribe — Subscribe to a gnmic network device state updates. More information: <https://gnmic.openconfig.net/cmd/subscribe/>.

Subscribe to target state updates under the subtree of a specific path:
gnmic {{[-a|--address]}} {{ip:port}} {{[sub|subscribe]}} --path {{path}}


Subscribe to a target with a sample interval of 30s (default is 10s):
gnmic {{[-a|--address]}} {{ip:port}} {{[sub|subscribe]}} --path {{path}} --sample-interval 30s


Subscribe to a target with sample interval and updates only on change:
gnmic {{[-a|--address]}} {{ip:port}} {{[sub|subscribe]}} --path {{path}} --stream-mode on-change --heartbeat-interval {{1m}}


Subscribe to a target for only one update:
gnmic {{[-a|--address]}} {{ip:port}} {{[sub|subscribe]}} --path {{path}} --mode once


Subscribe to a target and specify response encoding (json_ietf):
gnmic {{[-a|--address]}} {{ip:port}} {{[sub|subscribe]}} --path {{path}} {{[-e|--encoding]}} json_ietf

Code Snippets

Subscribe to target state updates under the subtree of a specific path

gnmic {{[-a|--address]}} {{ip:port}} {{[sub|subscribe]}} --path {{path}}

Subscribe to a target with a sample interval of 30s (default is 10s)

gnmic {{[-a|--address]}} {{ip:port}} {{[sub|subscribe]}} --path {{path}} --sample-interval 30s

Subscribe to a target with sample interval and updates only on change

gnmic {{[-a|--address]}} {{ip:port}} {{[sub|subscribe]}} --path {{path}} --stream-mode on-change --heartbeat-interval {{1m}}

Subscribe to a target for only one update

gnmic {{[-a|--address]}} {{ip:port}} {{[sub|subscribe]}} --path {{path}} --mode once

Subscribe to a target and specify response encoding (json_ietf)

gnmic {{[-a|--address]}} {{ip:port}} {{[sub|subscribe]}} --path {{path}} {{[-e|--encoding]}} json_ietf

Context

tldr-pages: common/gnmic subscribe

Revisions (0)

No revisions yet.