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
Hashes for iupy_restconf-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cc908b575bbc68776736a38744ae8bcd4039cf8d9ce906953bc2bebcb21cba1 |
|
MD5 | ea63c9e604d608435d2a23aa1220ed6f |
|
BLAKE2b-256 | abb706fb8d7307a5487b74065c8bc1790ec509305fa5d8e8e94809ada95e4268 |