-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated readme and requirements files
- Loading branch information
Tomas Kubina
committed
Jun 20, 2022
1 parent
cc3a431
commit 2d90ba5
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
xmltodict | ||
paramiko==2.8.1 | ||
ncclient | ||
pygnmi |