Skip to main content

A library for managing Cisco devices through NX-API using XML or jsonrpc.

Project description

nxapi-plumbing

A low-level library for managing Cisco devices through NX-API using JSON-RPC and XML.

Examples:

Creating device object using JSON-RPC.

from nxapi_plumbing import Device

device = Device(
    api_format="jsonrpc",
    host="device.domain.com",
    username="admin",
    password="password",
    transport="https",
    port=8443,
)

JSON-RPC single command that returns structured data.

output = device.show("show hostname")
print(output)

Output would be the response from the command

{'hostname': 'nxos.domain.com'}

JSON-RPC list of commands

output = device.show_list(["show hostname", "show ntp status"])
pprint(output)

Output would be a list of responses (list of dictionaries)

[
    {
        "command": "show hostname",
        "result": {
            "hostname": "nxos.domain.com"
        }
    },
    {
        "command": "show ntp status",
        "result": {
            "distribution": "Distribution : Disabled",
            "operational_state": "Last operational state: No session"
        }
    }
]

Project details


Release history Release notifications

This version

0.5.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for nxapi-plumbing, version 0.5.2
Filename, size File type Python version Upload date Hashes
Filename, size nxapi_plumbing-0.5.2.tar.gz (11.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page