Skip to content

Commit

Permalink
updated readme and requirements files
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Kubina committed Jun 20, 2022
1 parent cc3a431 commit 2d90ba5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
34 changes: 33 additions & 1 deletion README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# CSNOG 2022
This repository contains slides shared at CSNOG 2022 conference. It also contains several Python3 source coude files to demonstrate
This repository contains slides shared at CSNOG 2022 conference. It also contains several Python3 source code files to demonstrate
way how to work with NETCONF and gNMI API by using Python libraries.

Package [ncclient](https://github.com/ncclient/ncclient) was used for NETCONF testing and [gNMI](https://github.com/nokia/pygnmi) was used for gNMI protocol testing.

## How to use this repository
1. Install client libraries:
```bash
$ pip3 install -r requirements.txt
```
2. Enter folder with NETCONF or gNMI examples and select folder with scripts per OS platform. For example:
```bash
$ cd netconf_examples/iosxr
```
3. Open script based on RPC call type, change IP & port number and OS type if needed. Also update when needed content of request based on your network topology.
For NETCONF connection, modify parameters in connect() function:
```python
with manager.connect(host='192.168.243.21',
port=830,
username='username',
password='password',
hostkey_verify=False,
device_params={'name': 'iosxr'}) as session:
```
For gNMI connection, modify parameters in gNMIclient() constructor and host variable:
```python
host = ('192.168.243.21', '50001')

with gNMIclient(target=host, username='username', password='password', insecure=True, debug=0) as session:
```
4. Enable NETCONF / gNMI on your device following vendor documentation.
5. Run script.
```python
$ python3 get_full_config.py
```
6. Enjoy data from your device! And test other RPC calls for NETCONF or gNMI.
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
xmltodict
paramiko==2.8.1
ncclient
pygnmi

0 comments on commit 2d90ba5

Please sign in to comment.