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=}')
Changelog
1.0.0 - 1.0.3: Initial submissions
1.0.4: Fix #3: Don't use Walrus operator in code targeting python version 3.7.
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.4.tar.gz
(5.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file netpalm-client-1.0.4.tar.gz.
File metadata
- Download URL: netpalm-client-1.0.4.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.6rc1 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a595bd89f9b21a4cd22f5901c32ff77b38b9b39cf51b505049355ef244d8bcf
|
|
| MD5 |
c23500650510fdca6037e08cbf8dad32
|
|
| BLAKE2b-256 |
f803d8b49b15140af43563538459112f717508aabb48699b5bcfb6df626cc538
|
File details
Details for the file netpalm_client-1.0.4-py3-none-any.whl.
File metadata
- Download URL: netpalm_client-1.0.4-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.6rc1 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e57d02a0225279b596bc7d69a71be1bbd56e4147de6b109fcf2d58d82de4beb
|
|
| MD5 |
ca17b629c6c0e635bcfc2da61dd6c703
|
|
| BLAKE2b-256 |
3c4cb875c9b86c34c6deaee923f8fde83988151150892e0b6a57c337053a6b9d
|