Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

IOS-XR gRPC Python connectivity library.

License

NotificationsYou must be signed in to change notification settings

GomathiselviS/ios-xr-grpc-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Author: Karthik Kumaravel

This 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 asget andpush using YANG and JSON.

The repo consists of two main components:

  1. The compiled pb2 file from the proto definition.
  2. A Python module accessing the pb2 file with the library bindings.

The repo also includes examples on how to use the library to interact with an IOS-XR device. If you want to create your own client, there is a walkthroughat the bottom of this page.

If you find any problems or need help, create an issue!

Installation

Either download this repository or install withpip install iosxr_grpc

It is always recommended to work in a virtual environment with something likevirtualenv orpipenv.

gRPC Calls

Enable gRPC

SSH in to the router and turn on gRPC, below is an example configuration:

interface GigabitEthernet 0/0/0/0 ipv4 address 192.168.1.2 255.255.255.0 no shutgrpc port 57777 !!

Note: Default port is 57400, and IPv4 only.

Using TLS

  1. Enable TLS in configuration, example:
grpc  tls  port 57777  !!
  1. Copy the autogenerated .pem file to the 'keys' folder in the client directory.
scp cisco@192.168.1.2:/misc/config/grpc/ems.pem ./

Usage

from iosxr_grpc.cisco_grpc_client import CiscoGRPCClient

from iosxr_grpc.cisco_grpc_client import CiscoGRPCClientclient = CiscoGRPCClient(    <ip address>,    <port>,    <timeout>,    <username>,    <password>,    <optional: tls key>,    <optional: tls server name ('ems.cisco.com')>)path = <yang path> # '{"openconfig-interfaces:interfaces": [null]}')err, result = client.<operation>(path) # client.getconfig(path)

For a more in-depth look,check out the wiki!

Creating your own Client

To create a client of your own there are a few steps to follow.

Useful Links

If you would like to test this all out with IOS-XRv, use the following link to request access to the vagrant box.

https://xrdocs.github.io/

Projects that use the python client

Solenoid - App that injects routes directly into Cisco's IOS-XR RIB table.

Pipedown - CDN router monitoring tool for data center connectivity.

About

IOS-XR gRPC Python connectivity library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python100.0%

[8]ページ先頭

©2009-2025 Movatter.jp