Skip to main content

custom python module for NCS helpers

Project description

Overview

This module is intended to be installed on the production NCS nodes and imported in other services/actions that need to gather state from the network. It uses the NCS device manager and the standard python multiprocessing library to connect to devices in-parallel and issue commands, returning results as structured data.

Usage information

Basic usage example in an NCS callback:

from umnet_ncs.state import StateManager
...


class DemoAction(Action):
    @Action.action
    def cb_action(self, uinfo, name, kp, input, output, trans):
        ...
        with StateManager() as m:
            interfaces = m.get_state(al_devices, ["get-interface-details"])
            arp = m.get_state(dl_devices, ["get-arp-table"])
            ...

Supported commands

We attempt to normalize the output of each command based on how it is implemented. For example, we might default to just directly returning the data as-parsed by the ntc_templates module, or try and emulate for e.g. junos devices where we might have direct access to NETCONF RPCs via the NCS device manager.

Currently supported commands are:

  • get-mac-table
  • get-arp-table
  • get-interface-details
  • get-transciever-details

TODO

The models are mostly taken verbatim from the netsplash NCS package, and additional methods were added on top to support the stats.py module.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

umnet-pyncs-0.1.6.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

umnet_pyncs-0.1.6-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file umnet-pyncs-0.1.6.tar.gz.

File metadata

  • Download URL: umnet-pyncs-0.1.6.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.9.1 Darwin/21.6.0

File hashes

Hashes for umnet-pyncs-0.1.6.tar.gz
Algorithm Hash digest
SHA256 52c3c056b48b3957ddcf2c8dc34c8d65d70a215ba122d2441fa861118d8394f0
MD5 6cd68cd5730a49182178e8b7fe713c9e
BLAKE2b-256 acf6d27529599a25d9ee20faa4e695bab1523241cfaf8561a6cd53795142c9ce

See more details on using hashes here.

File details

Details for the file umnet_pyncs-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: umnet_pyncs-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.9.1 Darwin/21.6.0

File hashes

Hashes for umnet_pyncs-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8ee08dc2f4602a56ab1a0492318706160b54f553556bac46f216966562aaead9
MD5 2b0b9c7fbeba42ec5615bcb35e58704c
BLAKE2b-256 f81d93f27b47d48d7711e0a2e60a58266edd7b2641b383fd5374ef447bf559c0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page