Skip to main content

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.

Release files for nso-restconf 2.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nso-restconf 2.0.2
File Size Uploaded
nso_restconf-2.0.2.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nso-restconf 2.0.2
File Interpreter ABI Platform
nso_restconf-2.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 12.2 kB

Release files / nso_restconf-2.0.2.tar.gz

Download URL nso_restconf-2.0.2.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
155611618539d4aa2cf9b88c6a1a5aa8f5fe40dbdd13e72a7c2195ff1920e7e2
BLAKE2b-256 checksum
How to use checksums
641aee2e6f0956169b911cfc440422a5a01d5e2b2503d39e32b42ee96777b94a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.3

Release files / nso_restconf-2.0.2-py3-none-any.whl

Download URL nso_restconf-2.0.2-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3948d6f815202b871333472910129d02fd644ea1c116b23fbfb56564ebc7947b
BLAKE2b-256 checksum
How to use checksums
2e2e6a343331e58e6d49ecceec9556e5a94250c44357e49ab1ee438ffa7af4d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.3

Release history Release notifications | RSS feed

This release

2.0.2 This release

2 release files

1.4.0

2 release files

1.3.0

1 release file

1.2.0

1 release file

1.1.2

1 release file

1.1.1

2 release files

1.1.0

1 release file

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page