{"id":21636119,"url":"https://github.com/bigevilbeard/grpc_xr_getting_started","last_synced_at":"2026-05-10T15:34:43.055Z","repository":{"id":128721685,"uuid":"339061780","full_name":"bigevilbeard/grpc_xr_getting_started","owner":"bigevilbeard","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-16T14:32:02.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T23:50:26.753Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigevilbeard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2021-02-15T11:52:55.000Z","updated_at":"2021-02-16T14:32:04.000Z","dependencies_parsed_at":"2023-03-13T11:28:42.282Z","dependency_job_id":null,"html_url":"https://github.com/bigevilbeard/grpc_xr_getting_started","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bigevilbeard/grpc_xr_getting_started","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigevilbeard%2Fgrpc_xr_getting_started","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigevilbeard%2Fgrpc_xr_getting_started/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigevilbeard%2Fgrpc_xr_getting_started/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigevilbeard%2Fgrpc_xr_getting_started/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigevilbeard","download_url":"https://codeload.github.com/bigevilbeard/grpc_xr_getting_started/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigevilbeard%2Fgrpc_xr_getting_started/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32861596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"ssl_error","status_checked_at":"2026-05-10T13:40:02.145Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2024-11-25T03:30:01.716Z","updated_at":"2026-05-10T15:34:43.033Z","avatar_url":"https://github.com/bigevilbeard.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IOS-XR over GRPC\n\n\nThis public repo contains python code that can be used to interact with the Cisco IOS XR devices.The environment is pre-configured to access the [Cisco DevNet Always-On Sandbox](https://devnetsandbox.cisco.com/RM/Diagram/Index/e83cfd31-ade3-4e15-91d6-3118b867a0dd?diagramType=Topology). You can edit the variables in the environment to point to your own IOS-XR device.\n\n\nThis package contains a library with the methods that are available to use over gRPC with IOS-XR boxes after 6.0.0. The API has several methods which allows a user to send simple RPC commands such as get and push using YANG and JSON.\n\nThe repo consists of two main components:\n\nThe compiled pb2 file from the proto definition.\nA Python module accessing the pb2 file with the library bindings.\n\n## Information\n\nXR devices ship with the YANG files that define the data models they support. Using a management protocol such as NETCONF or gRPC, you can programmatically query a device for the list of models it supports and retrieve the model files.\n\ngRPC is an open-source RPC framework. It is based on Protocol Buffers (Protobuf), which is an open source binary serialization protocol. gRPC provides a flexible, efficient, automated mechanism for serializing structured data, like XML, but is smaller and simpler to use. You define the structure using protocol buffer message types in .proto files. Each protocol buffer message is a small logical record of information, containing a series of name-value pairs.\n\n### Enable gRPC\n\nSSH in to the Always-On Sandbox IOS XR router and turn on gRPC and disable tls, below is an example configuration\n\n```\ngrpc\n port 57777\n no-tls \n```\n\n\n### Python Environment Setup\nIt is recommended that this code be used with Python 3.6. It is highly recommended to leverage Python Virtual Environments (venv).\n\nFollow these steps to create and activate a venv.\n\n### OS X or Linux\n```\nvirtualenv venv --python=python3.6\nsource venv/bin/activate\n```\nInstall the code requirements\n\n```\npip install -r requirements.txt\n```\n\n## Code Example \"Get Interfaces\"\n\nTo get all the interfaces from the Always-On Sandbox IOS-XR device, we can run this small piece of code derived from OpenConfig YANG models and serialise this as `JSON`. Change to into the `examples` diretory and run the following code, this uses the yang model https://github.com/YangModels/yang/blob/master/vendor/cisco/xr/653/openconfig-interfaces.yang and will print all the interface from the Always-On Sandbox IOS-XR device in the `json` format.\n\n```\n(venv)python grpc_example.py \n{\n    \"openconfig-interfaces:interfaces\": {\n        \"interface\": [\n            {\n                \"name\": \"Loopback100\",\n                \"config\": {\n                    \"name\": \"Loopback100\",\n                    \"type\": \"iana-if-type:softwareLoopback\",\n                    \"enabled\": true,\n                    \"description\": \"***MERGE LOOPBACK 100****\"\n                },\n                \"subinterfaces\": {\n                    \"subinterface\": [\n                        {\n                            \"index\": 0,\n                            \"openconfig-if-ip:ipv4\": {\n                                \"addresses\": {\n                                    \"address\": [\n                                        {\n                                            \"ip\": \"1.1.1.100\",\n                                            \"config\": {\n                                                \"ip\": \"1.1.1.100\",\n                                                \"prefix-length\": 32\n                                            }\n                                        }\n                                    ]\n                                }\n                            }\n                        }\n                    ]\n                }\n            },\n[/snip]\n```\n\n\n\n## About me\n\nNetwork Automation Developer Advocate for Cisco DevNet.\nFind me here: [LinkedIn](https://www.linkedin.com/in/stuarteclark/) / [Twitter](https://twitter.com/bigevilbeard)\n\nThanks to Karthik Kumaravel and Patrick \"Bench Press 500\" Rockholz for their code samples and debugging skills.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigevilbeard%2Fgrpc_xr_getting_started","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigevilbeard%2Fgrpc_xr_getting_started","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigevilbeard%2Fgrpc_xr_getting_started/lists"}