IUPY RestConf Kit
Project description
iupy-restconf
Ian Underwood's Python RESTCONF Module
About
This package provides a RESTCONF class to manage interactions with network devices that use the RESTCONF protocol as defined in RFC-8040.
This document is woefully incomplete.
Installation
Module installation can be managed with PIP:
pip3 install iupy-restconf
Usage
This provides a top-level restconf import which should be imported into your project as such:
import restconf
router = restconf.RestConf()
router.connect(transport='https',
host='192.168.1.1',
un='restuser',
pw='restpass')
From there, using the module is a matter of defining the method and path that is useful for your application:
response = router.get("data/native/interfaces")
Operations such as push, post, and patch use a second positional arguement as a dictionary that provides the structure required.
response = router.post("data/openconfig-interfaces:interface", newconfig_dict)
Since RESTCONF is authorized on a per-request basis, there is no connection open or close method as with a general REST API which generates an stores a session.
Device Capabilities
Routers that are RFC-8040 compliant provide a list of modules that they support. This allows a script to check for basic capabilities.
router.get_data_modules()
if router.check_data_modules("Cisco-IOS-XE-native"):
print("This supports IOS-XE Native Calls")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file iupy_restconf-0.1.0.tar.gz
.
File metadata
- Download URL: iupy_restconf-0.1.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c37f2effa78750986ae1a621c3533263f58e99a35baf5c03ea99dbede70aae3 |
|
MD5 | 902604b06b3b805219069eb22f7c58c1 |
|
BLAKE2b-256 | b8483e758cc158da9d9d592ad7a6885f8167b48583013c238d5a38021e648109 |
File details
Details for the file iupy_restconf-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: iupy_restconf-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b54e5a9c81485abe63d5b4d114de9423ecd29346e1226bdd6818b22f262e9d6c |
|
MD5 | 9578faf5cc499fcf4308b6a667a47323 |
|
BLAKE2b-256 | e5cad4c0425a831c0c33aa1c3eb66a1d58282418df54a600012864492ea48e5a |