A wrapper for managing the API of NSO
Project description
nso_restconf
A wrapper of requests for managing the RestCONF API of NSO
This is an adaptation from Lisa Roach's PyRESTCONF code : https://github.com/lisroach/PyRESTCONF
Installation
pip install nso-restconf
Usage
For example, we retrieve the NED ids in a json structure :
from nso_restconf.restconf import RestConf
nso_api = RestConf(address="http://127.0.0.1", port=8080,
username="admin", password="admin")
res_ned_id = nso_api.get("tailf-ncs:devices/ned-ids/ned-id", content=None)
print(res_ned_id.json())
{
'tailf-ncs:ned-id': [
{
'id': 'tailf-ncs-ned:lsa-netconf'
},
{
'id': 'tailf-ncs-ned:netconf'
},
{
'id': 'tailf-ncs-ned:snmp'
},
{
'id': 'cisco-ios-cli-6.72:cisco-ios-cli-6.72',
'module': [
{
'name': 'ietf-interfaces',
'revision': '2014-05-08',
'namespace': 'urn:ietf:params:xml:ns:yang:ietf-interfaces'
},
...
Methods
Supported methods are GET,POST,PUT,PATCH,DELETE. There is others custom methods like action(), a wrapper of POST used to launch a NSO action. See the RestConf object source code for supported methods at : https://github.com/rtrjl/nso_restconf/blob/master/nso_restconf/restconf.py
License
This project is licensed to you under the terms of the Cisco Sample Code License.
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
nso_restconf-1.1.1.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for nso_restconf-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ae25f08fcdc9deb3cc5078bdf0d10238b0a0375668efbb452b692a0d1214be6 |
|
MD5 | fe6ded8c7af5f6ec774fb7e574e0ea75 |
|
BLAKE2b-256 | 863c13b1c041141d261bd2ead67c8f46e621d8cdd545ecf908c571eac56833b4 |