Skip to main content

Nornir connection plugin for the JSON RPC protocol

Project description

Nornir JSON RPC Plugin

Build Status PyPI version Python versions Code style: black Python Version from PEP 621 TOML

Nornir plugin for JSON-RPC.

Installation

pip install nornir-jsonrpc
uv add nornir-jsonrpc

Plugins

Connection

  • jsonrpc: uses httpx to connect to a device and transport JSON-RPC.

Tasks

  • jsonrpc_cli: Execute a CLI command.
  • jsonrpc_get: Retrieve data from the device.
  • jsonrpc_set: Set data on the device.
  • jsonrpc_update_config: Update a configuration element.
  • jsonrpc_replace_config: Replace a configuration element.
  • jsonrpc_delete_config: Delete a configuration element.

Usage

from nornir import InitNornir
from nornir_jsonrpc.tasks import jsonrpc_cli
from nornir_utils.plugins.functions import print_result

nr = InitNornir(config_file="config.yaml")

result = nr.run(
    task=jsonrpc_cli,
    cmds=["show version"],
)

print_result(result)

License

MIT

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

nornir_jsonrpc-0.2.13.tar.gz (46.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nornir_jsonrpc-0.2.13-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file nornir_jsonrpc-0.2.13.tar.gz.

File metadata

  • Download URL: nornir_jsonrpc-0.2.13.tar.gz
  • Upload date:
  • Size: 46.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.19

File hashes

Hashes for nornir_jsonrpc-0.2.13.tar.gz
Algorithm Hash digest
SHA256 eacf778967809f057a706b67114cb54ca070858ff42553038a0611a9f3b77cc6
MD5 bf2f37a90e6d47906ea6874bf33e4206
BLAKE2b-256 2b53246f6fe782185706d106cc68290f07ab0a9979068f2956b2e73a34190810

See more details on using hashes here.

File details

Details for the file nornir_jsonrpc-0.2.13-py3-none-any.whl.

File metadata

File hashes

Hashes for nornir_jsonrpc-0.2.13-py3-none-any.whl
Algorithm Hash digest
SHA256 f7a199024f8814628428f72d4b3619271b75b20c0e9de30c5f1eb69bb20a9ca7
MD5 44a2fac5209fa39d3f409e6e4a8e25a0
BLAKE2b-256 f4d02ad8031dd0cf236b99e8bf414ad63396bca86556521ac8bc33cd66d4da63

See more details on using hashes here.

Supported by

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