Code Monkey home page Code Monkey logo

nornir_pygnmi's Introduction

pyGNMI plugin for Nornir

project version coverage tag license

This repository contains GNMI plugin for Nornir leveraging pyGNMI library

Usage

Sample code example:

# Modules
from nornir.init_nornir import InitNornir
from nornir_utils.plugins.functions import print_result
from nornir_pygnmi.tasks import gnmi_capabilities

# Statics
NORNIR_CONFIG = "./config.yaml"

# Body
if __name__ == "__main__":
    # Initialise Nornir
    nrn = InitNornir(config_file=NORNIR_CONFIG)

    # Run task
    result1 = nrn.run(task=gnmi_capabilities)
    print_result(result1)

Installation

pip install nornir_pygnmi

Dev Log

Release 0.2.1:

  • Amended documentation to show possibility to use port key in the connection_options/pygnmi context.

Release 0.2.0:

  • Added new gnmi_subscribe() task. It supports all telemery subscription modes; however, from the Nornir perspective, the most benefitial is the once mode. In this case, the task will return a list containing output of all requested data. Such an approach is recommended by some vendors (e.g., Nokia) to collect huge data sets, which are not fitting into a single Get() RPC implemented in nornir_pygnmi as gnmi_get() task.

Release 0.1.2:

  • Added examples.
  • Modified communication of the task's status for all tasks.

Release 0.1.1:

  • Added gnmi_set() task.
  • Added placeholders for not-implemented methods.

Release 0.1.0:

  • First alpha release.

(c)2022, karneliuk.com

nornir_pygnmi's People

Contributors

akarneliuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nornir_pygnmi's Issues

Port for gNMI connection should be plugin-specific parameter

As suggested in https://karneliuk.com/wp-content/uploads/2022/08/Karneliuk_com_nornir_pygnmi.pdf slide 4

See e.g. https://salt-nornir.readthedocs.io/en/latest/Pillar%20and%20Inventory%20Examples.html#juniper-junos

proxy:
  proxytype: nornir

hosts:
  vmx1:
    hostname: 192.168.217.150
    platform: juniper_junos
    username: nornir
    password: nornir
    connection_options:
     ...
      scrapli_netconf:
        port: 830
        extras:
          transport: system # or paramiko, ssh2
          ssh_config_file: True
          auth_strict_key: False
      scrapli:
        platform: juniper_junos
        port: 22
        extras:
          transport: system # or asyncssh, ssh2, paramiko
          auth_strict_key: false
          ssh_config_file: false

Note how scrapli_netconf uses port 830, while scrapli uses port 22. The port is plugin specific, different plugins can use different ports to talk to a given device (in parallel)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.