Simple Client for accessing a Netpalm Service
Project description
Netpalm-Client
Simple client library for working with Netpalm
Detailed example available in examples folder of this repo
Install
pip install netpalm-client
Basic Usage
from netpalm_client import NetpalmClient
netpalm = NetpalmClient(
url='https://netpalm.example.org',
key='someApiKey',
cli_user='cisco',
cli_pass='cisco'
)
task_id = netpalm.netmiko_getconfig(
command='show run | i bgp router-id',
host='192.168.0.1'
)['task_id']
netpalm_result = netpalm.poll_task(task_id) # blocks until polling returns either completion or failure
actual_result = netpalm_result['task_result'][command] # failures will have a 'task_errors' key, but not a 'task_result' key.
print(f'{actual_result=}')
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
netpalm-client-1.0.3.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for netpalm_client-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5241c79e6e4715500f52baf3b50241c65280ffcec562c4b31e78e02b254c8352 |
|
MD5 | d5ff1c1dea8eb20a54ca0f7e906cbc17 |
|
BLAKE2b-256 | b99cf2a92bc7c16978f84512feb4de989da06dd9d4da8848a8b8901b9be30290 |