Skip to content

Commit afd782f

Browse files
committed
Change gnmcli to cisco-gnmi
1 parent 8238eda commit afd782f

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ This library wraps gNMI functionality to ease usage with Cisco implementations i
88
```bash
99
pip install cisco-gnmi
1010
python -c "import cisco_gnmi; print(cisco_gnmi)"
11-
gnmcli --help
11+
cisco-gnmi --help
1212
```
1313

14-
This library covers the gNMI defined `Capabilities`, `Get`, `Set`, and `Subscribe` RPCs, and helper clients provide OS-specific recommendations. A CLI is also available. As commonalities and differences are identified between OS functionality this library will be refactored as necessary.
14+
This library covers the gNMI defined `Capabilities`, `Get`, `Set`, and `Subscribe` RPCs, and helper clients provide OS-specific recommendations. A CLI (`cisco-gnmi`) is also available upon installation. As commonalities and differences are identified between OS functionality this library will be refactored as necessary.
1515

1616
It is *highly* recommended that users of the library learn [Google Protocol Buffers](https://developers.google.com/protocol-buffers/) syntax to significantly ease usage. Understanding how to read Protocol Buffers, and reference [`gnmi.proto`](https://github.com/openconfig/gnmi/blob/master/proto/gnmi/gnmi.proto), will be immensely useful for utilizing gNMI and any other gRPC interface.
1717

18-
### gnmcli
19-
Since `v1.0.5` a gNMI CLI is available when this module is installed. `Capabilities`, `Get`, rudimentary `Set`, and `Subscribe` are supported. The CLI may be useful for simply interacting with a Cisco gNMI service, and also serves as a reference for how to use this `cisco_gnmi` library. CLI usage is documented at the bottom of this README in [gnmcli Usage](#gnmcli-usage).
18+
### cisco-gnmi CLI
19+
Since `v1.0.5` a gNMI CLI is available as `cisco-gnmi` when this module is installed. `Capabilities`, `Get`, rudimentary `Set`, and `Subscribe` are supported. The CLI may be useful for simply interacting with a Cisco gNMI service, and also serves as a reference for how to use this `cisco_gnmi` library. CLI usage is documented at the bottom of this README in [CLI Usage](#cli-usage).
2020

2121
### ClientBuilder
2222
Since `v1.0.0` a builder pattern is available with `ClientBuilder`. `ClientBuilder` provides several `set_*` methods which define the intended `Client` connectivity and a `construct` method to construct and return the desired `Client`. There are several major methods involved here:
@@ -185,24 +185,24 @@ If a new `gnmi.proto` definition is released, use `update_protos.sh` to recompil
185185
./update_protos.sh
186186
```
187187

188-
### gnmcli Usage
189-
The below details the current `gnmcli` usage options. Please note that `Set` operations may be destructive to operations and should be tested in lab conditions.
188+
### CLI Usage
189+
The below details the current `cisco-gnmi` usage options. Please note that `Set` operations may be destructive to operations and should be tested in lab conditions.
190190

191191
```
192-
gnmcli --help
192+
cisco-gnmi --help
193193
usage:
194-
gnmcli <rpc> [<args>]
194+
cisco-gnmi <rpc> [<args>]
195195
196196
Supported RPCs:
197197
capabilities
198198
subscribe
199199
get
200200
set
201201
202-
gnmcli capabilities 127.0.0.1:57500
203-
gnmcli get 127.0.0.1:57500
204-
gnmcli set 127.0.0.1:57500 -delete_xpath Cisco-IOS-XR-shellutil-cfg:host-names/host-name
205-
gnmcli subscribe 127.0.0.1:57500 -debug -auto_ssl_target_override -dump_file intfcounters.proto.txt
202+
cisco-gnmi capabilities 127.0.0.1:57500
203+
cisco-gnmi get 127.0.0.1:57500
204+
cisco-gnmi set 127.0.0.1:57500 -delete_xpath Cisco-IOS-XR-shellutil-cfg:host-names/host-name
205+
cisco-gnmi subscribe 127.0.0.1:57500 -debug -auto_ssl_target_override -dump_file intfcounters.proto.txt
206206
207207
See <rpc> --help for RPC options.
208208
@@ -219,12 +219,12 @@ optional arguments:
219219
#### Capabilities
220220
This command will output the `CapabilitiesResponse` to `stdout`.
221221
```
222-
gnmcli capabilities 127.0.0.1:57500 -auto_ssl_target_override
222+
cisco-gnmi capabilities 127.0.0.1:57500 -auto_ssl_target_override
223223
```
224224

225225
```
226-
gnmcli capabilities --help
227-
usage: gnmcli [-h] [-os {None,IOS XR,NX-OS,IOS XE}]
226+
cisco-gnmi capabilities --help
227+
usage: cisco-gnmi [-h] [-os {None,IOS XR,NX-OS,IOS XE}]
228228
[-root_certificates ROOT_CERTIFICATES]
229229
[-private_key PRIVATE_KEY]
230230
[-certificate_chain CERTIFICATE_CHAIN]
@@ -258,11 +258,11 @@ optional arguments:
258258
#### Get
259259
This command will output the `GetResponse` to `stdout`. `-xpath` may be specified multiple times to specify multiple `Path`s for the `GetRequest`.
260260
```
261-
gnmcli get 127.0.0.1:57500 -os "IOS XR" -xpath /interfaces/interface/state/counters -auto_ssl_target_override
261+
cisco-gnmi get 127.0.0.1:57500 -os "IOS XR" -xpath /interfaces/interface/state/counters -auto_ssl_target_override
262262
```
263263

264264
```
265-
usage: gnmcli [-h] [-xpath XPATH]
265+
usage: cisco-gnmi [-h] [-xpath XPATH]
266266
[-encoding [{JSON,BYTES,PROTO,ASCII,JSON_IETF}]]
267267
[-data_type [{ALL,CONFIG,STATE,OPERATIONAL}]] [-dump_json]
268268
[-os {None,IOS XR,NX-OS,IOS XE}]
@@ -305,7 +305,7 @@ optional arguments:
305305
#### Set
306306
This command has not been validated. Please note that `Set` operations may be destructive to operations and should be tested in lab conditions.
307307
```
308-
usage: gnmcli [-h] [-update_json_config UPDATE_JSON_CONFIG]
308+
usage: cisco-gnmi [-h] [-update_json_config UPDATE_JSON_CONFIG]
309309
[-replace_json_config REPLACE_JSON_CONFIG]
310310
[-delete_xpath DELETE_XPATH] [-no_ietf] [-dump_json]
311311
[-os {None,IOS XR,NX-OS,IOS XE}]
@@ -350,12 +350,12 @@ optional arguments:
350350
#### Subscribe
351351
This command will output the `SubscribeResponse` to `stdout` or `-dump_file`. `-xpath` may be specified multiple times to specify multiple `Path`s for the `GetRequest`. Subscribe currently only supports a sampled stream. `ON_CHANGE` is possible but not implemented in the CLI, yet. :)
352352
```
353-
gnmcli subscribe 127.0.0.1:57500 -os "IOS XR" -xpath /interfaces/interface/state/counters -auto_ssl_target_override
353+
cisco-gnmi subscribe 127.0.0.1:57500 -os "IOS XR" -xpath /interfaces/interface/state/counters -auto_ssl_target_override
354354
```
355355

356356
```
357-
gnmcli subscribe --help
358-
usage: gnmcli [-h] [-xpath XPATH] [-interval INTERVAL] [-dump_file DUMP_FILE]
357+
cisco-gnmi subscribe --help
358+
usage: cisco-gnmi [-h] [-xpath XPATH] [-interval INTERVAL] [-dump_file DUMP_FILE]
359359
[-dump_json] [-sync_stop]
360360
[-encoding [{JSON,BYTES,PROTO,ASCII,JSON_IETF}]]
361361
[-os {None,IOS XR,NX-OS,IOS XE}]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@
6969
"coverage",
7070
],
7171
},
72-
entry_points={"console_scripts": ["gnmcli = cisco_gnmi.cli:main"]},
72+
entry_points={"console_scripts": ["cisco-gnmi = cisco_gnmi.cli:main"]},
7373
)

src/cisco_gnmi/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ def main():
4848
"set": gnmi_set,
4949
}
5050
parser = argparse.ArgumentParser(
51-
description="gNMI CLI demonstrating library usage.",
51+
description="gNMI CLI demonstrating cisco_gnmi library usage.",
5252
usage="""
53-
gnmcli <rpc> [<args>]
53+
cisco-gnmi <rpc> [<args>]
5454
5555
Supported RPCs:
5656
{supported_rpcs}
5757
58-
gnmcli capabilities 127.0.0.1:57500
59-
gnmcli get 127.0.0.1:57500 -xpath /interfaces/interface/state/counters
60-
gnmcli set 127.0.0.1:57500 -update_json_config newconfig.json
61-
gnmcli subscribe 127.0.0.1:57500 -xpath /interfaces/interface/state/counters -dump_file intfcounters.proto.txt
58+
cisco-gnmi capabilities 127.0.0.1:57500
59+
cisco-gnmi get 127.0.0.1:57500 -xpath /interfaces/interface/state/counters
60+
cisco-gnmi set 127.0.0.1:57500 -update_json_config newconfig.json
61+
cisco-gnmi subscribe 127.0.0.1:57500 -xpath /interfaces/interface/state/counters -dump_file intfcounters.proto.txt
6262
6363
See <rpc> --help for RPC options.
6464
""".format(

0 commit comments

Comments
 (0)