{"id":36487529,"url":"https://github.com/cisco-ie/cisco-gnmi-python","last_synced_at":"2026-01-12T01:52:46.952Z","repository":{"id":51647513,"uuid":"137940569","full_name":"cisco-ie/cisco-gnmi-python","owner":"cisco-ie","description":"CLI and library wrapping gNMI functionality to ease usage with Cisco implementations in Python programs.","archived":false,"fork":false,"pushed_at":"2023-12-06T20:49:13.000Z","size":337,"stargazers_count":40,"open_issues_count":41,"forks_count":18,"subscribers_count":15,"default_branch":"master","last_synced_at":"2026-01-05T08:28:32.312Z","etag":null,"topics":["gnmi","gnmi-client","ios-xe","ios-xr","nx-os","openconfig","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/cisco-gnmi/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cisco-ie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-19T20:11:41.000Z","updated_at":"2025-12-19T15:35:36.000Z","dependencies_parsed_at":"2023-12-06T21:45:10.729Z","dependency_job_id":null,"html_url":"https://github.com/cisco-ie/cisco-gnmi-python","commit_stats":{"total_commits":223,"total_committers":8,"mean_commits":27.875,"dds":0.2152466367713004,"last_synced_commit":"b3390c5b2fa6eff76717fcefc1e89540a5b0d3f4"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/cisco-ie/cisco-gnmi-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-ie%2Fcisco-gnmi-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-ie%2Fcisco-gnmi-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-ie%2Fcisco-gnmi-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-ie%2Fcisco-gnmi-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cisco-ie","download_url":"https://codeload.github.com/cisco-ie/cisco-gnmi-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-ie%2Fcisco-gnmi-python/sbom","scorecard":{"id":283340,"data":{"date":"2025-08-11","repo":{"name":"github.com/cisco-ie/cisco-gnmi-python","commit":"83cc2911bf6a1729f09cc01b3dd023c5f6dfc94f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":3,"reason":"Found 5/16 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: scripts/Dockerfile:1: pin your Docker image by updating python:3-alpine to python:3-alpine@sha256:af1fd7a973d8adc761ee6b9d362b99329b39eb096ea3c53b8838f99bd187011e","Warn: pipCommand not pinned by hash: scripts/Dockerfile:3","Info:   0 out of   1 pipCommand dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-3ww4-gg4f-jr7f","Warn: Project is vulnerable to: GHSA-5cpq-8wj7-hf2v","Warn: Project is vulnerable to: GHSA-9v9h-cgj8-h64p","Warn: Project is vulnerable to: PYSEC-2021-62 / GHSA-hggm-jpg3-v476","Warn: Project is vulnerable to: GHSA-jm77-qphf-c4w8","Warn: Project is vulnerable to: GHSA-v8gr-m533-ghj9","Warn: Project is vulnerable to: GHSA-w7pp-m8wf-vj6r","Warn: Project is vulnerable to: GHSA-x4qr-2fvf-3mr5","Warn: Project is vulnerable to: GHSA-496j-2rq6-j6cc","Warn: Project is vulnerable to: PYSEC-2022-48 / GHSA-77rm-9x9h-xj3g","Warn: Project is vulnerable to: GHSA-8gq9-2x98-w8hf","Warn: Project is vulnerable to: GHSA-8qvm-5x2c-j2w7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T16:32:13.311Z","repository_id":51647513,"created_at":"2025-08-17T16:32:13.311Z","updated_at":"2025-08-17T16:32:13.311Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gnmi","gnmi-client","ios-xe","ios-xr","nx-os","openconfig","python"],"created_at":"2026-01-12T01:52:46.881Z","updated_at":"2026-01-12T01:52:46.936Z","avatar_url":"https://github.com/cisco-ie.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cisco-gnmi-python\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\nThis library wraps gNMI functionality to ease usage with Cisco implementations in Python programs. Derived from [openconfig/gnmi](https://github.com/openconfig/gnmi/tree/master/proto).\n\n**This is not an officially supported Cisco product.** This library is intended to serve as a gNMI client reference implementation and streamline development with Cisco products.\n\n- [cisco-gnmi-python](#cisco-gnmi-python)\n  - [Usage](#usage)\n    - [cisco-gnmi CLI](#cisco-gnmi-cli)\n    - [ClientBuilder](#clientbuilder)\n      - [Initialization Examples](#initialization-examples)\n    - [Client](#client)\n    - [NXClient](#nxclient)\n    - [XEClient](#xeclient)\n    - [XRClient](#xrclient)\n  - [gNMI](#gnmi)\n  - [Development](#development)\n    - [Get Source](#get-source)\n    - [Code Hygiene](#code-hygiene)\n    - [Recompile Protobufs](#recompile-protobufs)\n  - [CLI Usage](#cli-usage)\n    - [Capabilities](#capabilities)\n      - [Usage](#usage-1)\n      - [Output](#output)\n    - [Get](#get)\n      - [Usage](#usage-2)\n      - [Output](#output-1)\n    - [Set](#set)\n      - [Usage](#usage-3)\n      - [Output](#output-2)\n    - [Subscribe](#subscribe)\n      - [Usage](#usage-4)\n      - [Output](#output-3)\n  - [Licensing](#licensing)\n  - [Issues](#issues)\n  - [Related Projects](#related-projects)\n\n## Usage\n```bash\npip install cisco-gnmi\npython -c \"import cisco_gnmi; print(cisco_gnmi)\"\ncisco-gnmi --help\n```\n\nThis 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.\n\nSeveral examples of library usage are available in [`examples/`](examples/). The `cisco-gnmi` CLI script found at [`src/cisco_gnmi/cli.py`](src/cisco_gnmi/cli.py) may also be useful.\n\nIt 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.\n\n### cisco-gnmi CLI\nSince `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).\n\n### ClientBuilder\nSince `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:\n\n```\n    set_target(...)\n        Specifies the network element to build a client for.\n    set_os(...)\n        Specifies which OS wrapper to deliver.\n    set_secure(...)\n        Specifies that a secure gRPC channel should be used.\n    set_secure_from_file(...)\n        Loads certificates from file system for secure gRPC channel.\n    set_secure_from_target(...)\n        Attempts to utilize available certificate from target for secure gRPC channel.\n    set_call_authentication(...)\n        Specifies username/password to utilize for authentication.\n    set_ssl_target_override(...)\n        Sets the gRPC option to override the SSL target name.\n    set_channel_option(...)\n        Sets a gRPC channel option. Implies knowledge of channel options.\n    construct()\n        Constructs and returns the built Client.\n```\n\n#### Initialization Examples\n`ClientBuilder` can be chained for initialization or instantiated line-by-line.\n\n```python\nfrom cisco_gnmi import ClientBuilder\n\nbuilder = ClientBuilder('127.0.0.1:9339')\nbuilder.set_os('IOS XR')\nbuilder.set_secure_from_target()\nbuilder.set_call_authentication('admin', 'its_a_secret')\nclient = builder.construct()\n\n# Or...\n\nclient = ClientBuilder('127.0.0.1:9339').set_os('IOS XR').set_secure_from_target().set_call_authentication('admin', 'its_a_secret').construct()\n```\n\nUsing an encrypted channel automatically getting the certificate from the device, quick for testing:\n\n```python\nfrom cisco_gnmi import ClientBuilder\n\nclient = ClientBuilder(\n    '127.0.0.1:9339'\n).set_os('IOS XR').set_secure_from_target().set_call_authentication(\n    'admin',\n    'its_a_secret'\n).construct()\n```\n\nUsing an owned root certificate on the filesystem:\n\n```python\nfrom cisco_gnmi import ClientBuilder\n\nclient = ClientBuilder(\n    '127.0.0.1:9339'\n).set_os('IOS XR').set_secure_from_file(\n    'ems.pem'\n).set_call_authentication(\n    'admin',\n    'its_a_secret'\n).construct()\n```\n\nPassing certificate content to method:\n\n```python\nfrom cisco_gnmi import ClientBuilder\n\n# Note reading as bytes\nwith open('ems.pem', 'rb') as cert_fd:\n    root_cert = cert_fd.read()\n\nclient = ClientBuilder(\n    '127.0.0.1:9339'\n).set_os('IOS XR').set_secure(\n    root_cert\n).set_call_authentication(\n    'admin',\n    'its_a_secret'\n).construct()\n```\n\nUsage with root certificate, private key, and cert chain:\n\n```python\nfrom cisco_gnmi import ClientBuilder\n\nclient = ClientBuilder(\n    '127.0.0.1:9339'\n).set_os('IOS XE').set_secure_from_file(\n    root_certificates='rootCA.pem',\n    private_key='client.key',\n    certificate_chain='client.crt',\n).set_call_authentication(\n    'admin',\n    'its_a_secret'\n).construct()\n```\n\n\n### Client\n`Client` is a very barebones class simply implementing `capabilities`, `get`, `set`, and `subscribe` methods. It provides some context around the expectation for what should be supplied to these RPC functions and helpers for validation.\n\nMethods are documented in [`src/cisco_gnmi/client.py`](src/cisco_gnmi/client.py).\n\n### NXClient\n`NXClient` inherits from `Client` and provides several wrapper methods which aid with NX-OS gNMI implementation usage. These are `subscribe_xpaths`, and the removal of `get` and `set` as they are not yet supported operations. These methods have some helpers and constraints around what is supported by the implementation.\n\nMethods and usage examples are documented in [`src/cisco_gnmi/nx.py`](src/cisco_gnmi/nx.py).\n\n### XEClient\n`XEClient` inherits from `Client` and provides several wrapper methods which aid with IOS XE gNMI implementation usage. These are `delete_xpaths`, `get_xpaths`, `set_json`, and `subscribe_xpaths`. These methods have some helpers and constraints around what is supported by the implementation.\n\nMethods and usage examples are documented in [`src/cisco_gnmi/xe.py`](src/cisco_gnmi/xe.py).\n\n### XRClient\n`XRClient` inherits from `Client` and provides several wrapper methods which aid with IOS XR gNMI implementation usage. These are `delete_xpaths`, `get_xpaths`, `set_json`, and `subscribe_xpaths`. These methods have some helpers and constraints around what is supported by the implementation.\n\nMethods and usage examples are documented in [`src/cisco_gnmi/xr.py`](src/cisco_gnmi/xr.py).\n\n## gNMI\ngRPC Network Management Interface (gNMI) is a service defining an interface for a network management system (NMS) to interact with a network element. It may be thought of as akin to NETCONF or other control protocols which define operations and behaviors. The scope of gNMI is relatively simple - it seeks to \"[[define](https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md)] a gRPC-based protocol for the modification and retrieval of configuration from a target device, as well as the control and generation of telemetry streams from a target device to a data collection system. The intention is that a single gRPC service definition can cover both configuration and telemetry - allowing a single implementation on the target, as well as a single NMS element to interact with the device via telemetry and configuration RPCs\".\n\ngNMI is a specification developed by [OpenConfig](https://openconfig.net), an operator-driven working-group. It is important to note that gNMI only defines a protocol of behavior - not data models. This is akin to SNMP/MIBs and NETCONF/YANG. SNMP and NETCONF are respectively decoupled from the data itself in MIBs and YANG modules. gNMI is a control protocol, not a standardization of data. OpenConfig does develop standard data models as well, and does have some specialized behavior with OpenConfig originating models, but the data models themselves are out of the scope of gNMI.\n\n## Development\nRequires Python and utilizes `pipenv` for environment management. Manual usage of `pip`/`virtualenv` is not covered. Uses `black` for code formatting and `pylint` for code linting. `black` is not explicitly installed as it requires Python 3.6+.\n\n### Get Source\n```bash\ngit clone https://github.com/cisco-ie/cisco-gnmi-python.git\ncd cisco-gnmi-python\n# If pipenv not installed, install!\npip install --user pipenv\n# Now use Makefile...\nmake setup\n# Or pipenv manually if make not present\npipenv --three install --dev\n# Enter virtual environment\npipenv shell\n# Work work\nexit\n```\n\n### Code Hygiene\nWe use [`black`](https://github.com/ambv/black) for code formatting and [`pylint`](https://www.pylint.org/) for code linting. `hygiene.sh` will run `black` against all of the code under `gnmi/` except for `protoc` compiled protobufs, and run `pylint` against Python files directly under `gnmi/`. They don't totally agree, so we're not looking for perfection here. `black` is not automatically installed due to requiring Python 3.6+. `hygiene.sh` will check for regular path availability and via `pipenv`, and otherwise falls directly to `pylint`. If `black` usage is desired, please install it into `pipenv` if using Python 3.6+ or separate methods e.g. `brew install black`.\n\n```bash\n# If using Python 3.6+\npipenv install --dev black\n# Otherwise...\n./hygiene.sh\n```\n\n### Recompile Protobufs\nIf a new `gnmi.proto` definition is released, use `update_protos.sh` to recompile. If breaking changes are introduced the wrapper library must be updated.\n\n```bash\n./update_protos.sh\n```\n\n## CLI Usage\nThe 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.\n\n```\ncisco-gnmi --help\nusage:\ncisco-gnmi \u003crpc\u003e [\u003cargs\u003e]\n\nSupported RPCs:\ncapabilities\nsubscribe\nget\nset\n\ncisco-gnmi capabilities 127.0.0.1:57500\ncisco-gnmi get 127.0.0.1:57500\ncisco-gnmi set 127.0.0.1:57500 -delete_xpath Cisco-IOS-XR-shellutil-cfg:host-names/host-name\ncisco-gnmi subscribe 127.0.0.1:57500 -debug -auto_ssl_target_override -dump_file intfcounters.proto.txt\n\nSee \u003crpc\u003e --help for RPC options.\n\n\ngNMI CLI demonstrating library usage.\n\npositional arguments:\n  rpc         gNMI RPC to perform against network element.\n\noptional arguments:\n  -h, --help  show this help message and exit\n```\n\n### Capabilities\nThis command will output the `CapabilitiesResponse` to `stdout`.\n```\ncisco-gnmi capabilities 127.0.0.1:57500 -auto_ssl_target_override\n```\n\n#### Usage\n```\ncisco-gnmi capabilities --help\nusage: cisco-gnmi [-h] [-os {None,IOS XR,NX-OS,IOS XE}]\n                  [-root_certificates ROOT_CERTIFICATES]\n                  [-private_key PRIVATE_KEY]\n                  [-certificate_chain CERTIFICATE_CHAIN]\n                  [-ssl_target_override SSL_TARGET_OVERRIDE]\n                  [-auto_ssl_target_override] [-debug]\n                  netloc\n\nPerforms Capabilities RPC against network element.\n\npositional arguments:\n  netloc                \u003chost\u003e:\u003cport\u003e\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -os {None,IOS XR,NX-OS,IOS XE}\n                        OS wrapper to utilize. Defaults to IOS XR.\n  -root_certificates ROOT_CERTIFICATES\n                        Root certificates for secure connection.\n  -private_key PRIVATE_KEY\n                        Private key for secure connection.\n  -certificate_chain CERTIFICATE_CHAIN\n                        Certificate chain for secure connection.\n  -ssl_target_override SSL_TARGET_OVERRIDE\n                        gRPC SSL target override option.\n  -auto_ssl_target_override\n                        Use root_certificates first CN as\n                        grpc.ssl_target_name_override.\n  -debug                Print debug messages.\n```\n\n#### Output\n```\n[cisco-gnmi-python] cisco-gnmi capabilities redacted:57500 -auto_ssl_target_override\nUsername: admin\nPassword:\nWARNING:root:Overriding SSL option from certificate could increase MITM susceptibility!\nINFO:root:supported_models {\n  name: \"Cisco-IOS-XR-qos-ma-oper\"\n  organization: \"Cisco Systems, Inc.\"\n  version: \"2019-04-05\"\n}\n...\n```\n\n### Get\nThis command will output the `GetResponse` to `stdout`. `-xpath` may be specified multiple times to specify multiple `Path`s for the `GetRequest`.\n```\ncisco-gnmi get 127.0.0.1:57500 -os \"IOS XR\" -xpath /interfaces/interface/state/counters -auto_ssl_target_override\n```\n\n#### Usage\n```\ncisco-gnmi get --help\nusage: cisco-gnmi [-h] [-xpath XPATH]\n                  [-encoding {JSON,BYTES,PROTO,ASCII,JSON_IETF}]\n                  [-data_type {ALL,CONFIG,STATE,OPERATIONAL}] [-dump_json]\n                  [-os {None,IOS XR,NX-OS,IOS XE}]\n                  [-root_certificates ROOT_CERTIFICATES]\n                  [-private_key PRIVATE_KEY]\n                  [-certificate_chain CERTIFICATE_CHAIN]\n                  [-ssl_target_override SSL_TARGET_OVERRIDE]\n                  [-auto_ssl_target_override] [-debug]\n                  netloc\n\nPerforms Get RPC against network element.\n\npositional arguments:\n  netloc                \u003chost\u003e:\u003cport\u003e\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -xpath XPATH          XPaths to Get.\n  -encoding {JSON,BYTES,PROTO,ASCII,JSON_IETF}\n                        gNMI Encoding.\n  -data_type {ALL,CONFIG,STATE,OPERATIONAL}\n                        gNMI GetRequest DataType\n  -dump_json            Dump as JSON instead of textual protos.\n  -os {None,IOS XR,NX-OS,IOS XE}\n                        OS wrapper to utilize. Defaults to IOS XR.\n  -root_certificates ROOT_CERTIFICATES\n                        Root certificates for secure connection.\n  -private_key PRIVATE_KEY\n                        Private key for secure connection.\n  -certificate_chain CERTIFICATE_CHAIN\n                        Certificate chain for secure connection.\n  -ssl_target_override SSL_TARGET_OVERRIDE\n                        gRPC SSL target override option.\n  -auto_ssl_target_override\n                        Use root_certificates first CN as\n                        grpc.ssl_target_name_override.\n  -debug                Print debug messages.\n```\n\n#### Output\n```\n[cisco-gnmi-python] cisco-gnmi get redacted:57500 -os \"IOS XR\" -xpath /interfaces/interface/state/counters -auto_ssl_target_override\nUsername: admin\nPassword:\nWARNING:root:Overriding SSL option from certificate could increase MITM susceptibility!\nINFO:root:notification {\n  timestamp: 1585607100869287743\n  update {\n    path {\n      elem {\n        name: \"interfaces\"\n      }\n      elem {\n        name: \"interface\"\n      }\n      elem {\n        name: \"state\"\n      }\n      elem {\n        name: \"counters\"\n      }\n    }\n    val {\n      json_ietf_val: \"{\\\"in-unicast-pkts\\\":\\\"0\\\",\\\"in-octets\\\":\\\"0\\\"...\n```\n\n### Set\nPlease note that `Set` operations may be destructive to operations and should be tested in lab conditions. Behavior is not fully validated.\n\n#### Usage\n```\ncisco-gnmi set --help\nusage: cisco-gnmi [-h] [-update_json_config UPDATE_JSON_CONFIG]\n                  [-replace_json_config REPLACE_JSON_CONFIG]\n                  [-delete_xpath DELETE_XPATH] [-no_ietf] [-dump_json]\n                  [-os {None,IOS XR,NX-OS,IOS XE}]\n                  [-root_certificates ROOT_CERTIFICATES]\n                  [-private_key PRIVATE_KEY]\n                  [-certificate_chain CERTIFICATE_CHAIN]\n                  [-ssl_target_override SSL_TARGET_OVERRIDE]\n                  [-auto_ssl_target_override] [-debug]\n                  netloc\n\nPerforms Set RPC against network element.\n\npositional arguments:\n  netloc                \u003chost\u003e:\u003cport\u003e\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -update_json_config UPDATE_JSON_CONFIG\n                        JSON-modeled config to apply as an update.\n  -replace_json_config REPLACE_JSON_CONFIG\n                        JSON-modeled config to apply as a replace.\n  -delete_xpath DELETE_XPATH\n                        XPaths to delete.\n  -no_ietf              JSON is not IETF conformant.\n  -dump_json            Dump as JSON instead of textual protos.\n  -os {None,IOS XR,NX-OS,IOS XE}\n                        OS wrapper to utilize. Defaults to IOS XR.\n  -root_certificates ROOT_CERTIFICATES\n                        Root certificates for secure connection.\n  -private_key PRIVATE_KEY\n                        Private key for secure connection.\n  -certificate_chain CERTIFICATE_CHAIN\n                        Certificate chain for secure connection.\n  -ssl_target_override SSL_TARGET_OVERRIDE\n                        gRPC SSL target override option.\n  -auto_ssl_target_override\n                        Use root_certificates first CN as\n                        grpc.ssl_target_name_override.\n  -debug                Print debug messages.\n```\n\n#### Output\nLet's create a harmless loopback interface based from [`openconfig-interfaces.yang`](https://github.com/openconfig/public/blob/master/release/models/interfaces/openconfig-interfaces.yang).\n\n`config.json`\n```json\n{\n    \"openconfig-interfaces:interfaces\": {\n        \"interface\": [\n            {\n                \"name\": \"Loopback9339\"\n            }\n        ]\n    }\n}\n```\n\n```\n[cisco-gnmi-python] cisco-gnmi set redacted:57500 -os \"IOS XR\" -auto_ssl_target_override -update_json_config config.json\nUsername: admin\nPassword:\nWARNING:root:Overriding SSL option from certificate could increase MITM susceptibility!\nINFO:root:response {\n  path {\n    origin: \"openconfig-interfaces\"\n    elem {\n      name: \"interfaces\"\n    }\n  }\n  message {\n  }\n  op: UPDATE\n}\nmessage {\n}\ntimestamp: 1585715036783451369\n```\n\nAnd on IOS XR...a loopback interface!\n```\n...\ninterface Loopback9339\n!\n...\n```\n\n### Subscribe\nThis command will output the `SubscribeResponse` to `stdout` or `-dump_file`. `-xpath` may be specified multiple times to specify multiple `Path`s for the `GetRequest`.\n\n```\ncisco-gnmi subscribe 127.0.0.1:57500 -os \"IOS XR\" -xpath /interfaces/interface/state/counters -auto_ssl_target_override\n```\n\n#### Usage\n```\ncisco-gnmi subscribe --help\nusage: cisco-gnmi [-h] [-xpath XPATH] [-interval INTERVAL]\n                  [-mode {TARGET_DEFINED,ON_CHANGE,SAMPLE}]\n                  [-suppress_redundant]\n                  [-heartbeat_interval HEARTBEAT_INTERVAL]\n                  [-dump_file DUMP_FILE] [-dump_json] [-sync_stop]\n                  [-sync_start] [-encoding {JSON,BYTES,PROTO,ASCII,JSON_IETF}]\n                  [-os {None,IOS XR,NX-OS,IOS XE}]\n                  [-root_certificates ROOT_CERTIFICATES]\n                  [-private_key PRIVATE_KEY]\n                  [-certificate_chain CERTIFICATE_CHAIN]\n                  [-ssl_target_override SSL_TARGET_OVERRIDE]\n                  [-auto_ssl_target_override] [-debug]\n                  netloc\n\nPerforms Subscribe RPC against network element.\n\npositional arguments:\n  netloc                \u003chost\u003e:\u003cport\u003e\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -xpath XPATH          XPath to subscribe to.\n  -interval INTERVAL    Sample interval in seconds for Subscription. Defaults\n                        to 10.\n  -mode {TARGET_DEFINED,ON_CHANGE,SAMPLE}\n                        SubscriptionMode for Subscription. Defaults to SAMPLE.\n  -suppress_redundant   Suppress redundant information in Subscription.\n  -heartbeat_interval HEARTBEAT_INTERVAL\n                        Heartbeat interval in seconds.\n  -dump_file DUMP_FILE  Filename to dump to. Defaults to stdout.\n  -dump_json            Dump as JSON instead of textual protos.\n  -sync_stop            Stop on sync_response.\n  -sync_start           Start processing messages after sync_response.\n  -encoding {JSON,BYTES,PROTO,ASCII,JSON_IETF}\n                        gNMI Encoding. Defaults to whatever Client wrapper\n                        prefers.\n  -os {None,IOS XR,NX-OS,IOS XE}\n                        OS wrapper to utilize. Defaults to IOS XR.\n  -root_certificates ROOT_CERTIFICATES\n                        Root certificates for secure connection.\n  -private_key PRIVATE_KEY\n                        Private key for secure connection.\n  -certificate_chain CERTIFICATE_CHAIN\n                        Certificate chain for secure connection.\n  -ssl_target_override SSL_TARGET_OVERRIDE\n                        gRPC SSL target override option.\n  -auto_ssl_target_override\n                        Use root_certificates first CN as\n                        grpc.ssl_target_name_override.\n  -debug                Print debug messages.\n```\n\n#### Output\n```\n[cisco-gnmi-python] cisco-gnmi subscribe redacted:57500 -os \"IOS XR\" -xpath /interfaces/interface/state/counters -auto_ssl_target_override\nUsername: admin\nPassword:\nWARNING:root:Overriding SSL option from certificate could increase MITM susceptibility!\nINFO:root:Dumping responses to stdout as textual proto ...\nINFO:root:Subscribing to:\n/interfaces/interface/state/counters\nINFO:root:update {\n  timestamp: 1585607768601000000\n  prefix {\n    origin: \"openconfig\"\n    elem {\n      name: \"interfaces\"\n    }\n    elem {\n      name: \"interface\"\n      key {\n        key: \"name\"\n        value: \"Null0\"\n      }\n    }\n    elem {\n      name: \"state\"\n    }\n    elem {\n      name: \"counters\"\n    }\n  }\n  update {\n    path {\n      elem {\n        name: \"in-octets\"\n      }\n    }\n    val {\n      uint_val: 0\n    }\n  }\n...\n```\n\n## Licensing\n`cisco-gnmi-python` is licensed as [Apache License, Version 2.0](LICENSE).\n\n## Issues\nOpen an issue :)\n\n## Related Projects\n1. [openconfig/gnmi](https://github.com/openconfig/gnmi)\n2. [google/gnxi](https://github.com/google/gnxi)\n3. [Telegraf Cisco gNMI Plugin](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/cisco_telemetry_gnmi)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcisco-ie%2Fcisco-gnmi-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcisco-ie%2Fcisco-gnmi-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcisco-ie%2Fcisco-gnmi-python/lists"}