From ec300f80fa2d239ebf2a1b46afddc12468370506 Mon Sep 17 00:00:00 2001 From: Alexandre Hassan Date: Thu, 1 Sep 2022 14:57:16 -0400 Subject: [PATCH] gnmic: add page and subpages (#8367) * gnmic - add * Change file extension * Fix newlines * update gnmic pages and add gnmic sub alias * fix link * add period * fix missing punctuation * fix ip:port formatting * Implemented @adrienthebo suggestions * missing period * @EmilySeville7cfg suggestions * remove --insecure and write out sub --- pages/common/gnmic-get.md | 20 ++++++++++++++++++++ pages/common/gnmic-set.md | 20 ++++++++++++++++++++ pages/common/gnmic-sub.md | 8 ++++++++ pages/common/gnmic-subscribe.md | 24 ++++++++++++++++++++++++ pages/common/gnmic.md | 25 +++++++++++++++++++++++++ 5 files changed, 97 insertions(+) create mode 100644 pages/common/gnmic-get.md create mode 100644 pages/common/gnmic-set.md create mode 100644 pages/common/gnmic-sub.md create mode 100644 pages/common/gnmic-subscribe.md create mode 100644 pages/common/gnmic.md diff --git a/pages/common/gnmic-get.md b/pages/common/gnmic-get.md new file mode 100644 index 000000000..300a51dd0 --- /dev/null +++ b/pages/common/gnmic-get.md @@ -0,0 +1,20 @@ +# gnmic get + +> Get a snapshot of a gnmi network device operation data. +> More information: . + +- Get a snapshot of the device state at a specific path: + +`gnmic --address {{ip:port}} get --path {{path}}` + +- Query the device state at multiple paths: + +`gnmic -a {{ip:port}} get --path {{path1}} --path {{path2}}` + +- Query the device state at multiple paths with a common prefix: + +`gnmic -a {{ip:port}} get --prefix {{prefix}} --path {{path1}} --path {{path2}}` + +- Query the device state and specify reponse encoding (json_ietf): + +`gnmic -a {{ip:port}} get --path {{path}} --encoding json_ietf` diff --git a/pages/common/gnmic-set.md b/pages/common/gnmic-set.md new file mode 100644 index 000000000..f2229eb4b --- /dev/null +++ b/pages/common/gnmic-set.md @@ -0,0 +1,20 @@ +# gnmic set + +> Modify gnmi network device configuration. +> More information: . + +- Update the value of a path: + +`gnmic --address {{ip:port}} set --update-path {{path}} --update-value {{value}}` + +- Update the value of a path to match the contents of a json file: + +`gnmic -a {{ip:port}} set --update-path {{path}} --update-file {{filepath}}` + +- Replace the value of a path to match the contents of a json file: + +`gnmic -a {{ip:port}} set --replace-path {{path}} --replace-file {{filepath}}` + +- Delete the node at a given path: + +`gnmic -a {{ip:port}} set --delete {{path}}` diff --git a/pages/common/gnmic-sub.md b/pages/common/gnmic-sub.md new file mode 100644 index 000000000..b7a0d761f --- /dev/null +++ b/pages/common/gnmic-sub.md @@ -0,0 +1,8 @@ +# gnmic sub + +> This command is an alias of `gnmic subscribe`. +> More information: . + +- View documentation for the original command: + +`tldr gnmic subscribe` diff --git a/pages/common/gnmic-subscribe.md b/pages/common/gnmic-subscribe.md new file mode 100644 index 000000000..d547f7a39 --- /dev/null +++ b/pages/common/gnmic-subscribe.md @@ -0,0 +1,24 @@ +# gnmic subscribe + +> Subscribe to a gnmic network device state updates. +> More information: . + +- Subscribe to target state updates under the subtree of a specific path: + +`gnmic --address {{ip:port}} subscribe --path {{path}}` + +- Subscribe to a target with a sample interval of 30s (default is 10s): + +`gnmic -a {{ip:port}} subscribe --path {{path}} --sample-interval 30s` + +- Subscribe to a target with sample interval and updates only on change: + +`gnmic -a {{ip:port}} subscribe --path {{path}} --stream-mode on-change --heartbeat-interval 1m` + +- Subscribe to a target for only one update: + +`gnmic -a {{ip:port}} subscribe --path {{path}} --mode once` + +- Subscribe to a target and specify reponse encoding (json_ietf): + +`gnmic -a {{ip:port}} subscribe --path {{path}} --encoding json_ietf` diff --git a/pages/common/gnmic.md b/pages/common/gnmic.md new file mode 100644 index 000000000..d0a06a658 --- /dev/null +++ b/pages/common/gnmic.md @@ -0,0 +1,25 @@ +# gnmic + +> A gNMI command-line client. +> Manage gNMI network device configuration and view operational data. +> More information: . + +- Request device capabilities: + +`gnmic --address {{ip:port}} capabilities` + +- Provide a username and password to fetch device capabilities: + +`gnmic --address {{ip:port}} --username {{username}} --password {{password}} capabilities` + +- Get a snapshot of the device state at a specific path: + +`gnmic -a {{ip:port}} get --path {{path}}` + +- Update device state at a specific path: + +`gnmic -a {{ip:port}} set --update-path {{path}} --update-value {{value}}` + +- Subscribe to target state updates under the subtree at a specific path: + +`gnmic -a {{ip:port}} subscribe --path {{path}}`