NX-API Part 1

I thought I’d start with a quick “how to” demo for Cisco’s Nexus9000 NX-API.  Since I’m not in marketing I probably won’t do too many videos.  However, for NX-API I really wanted to capture everyone’s attention and what better way then in video format!

Below is the code snippet from the video:

import requests
import json

Modify these please

    "jsonrpc": "2.0",
    "method": "cli",
    "params": {
       "cmd": "show version",
       "version": 1
    "id": 1
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()

# pretty print the JSON object
print json.dumps(response , sort_keys=True, indent=4, separators=(',', ': '))

One thought on “NX-API Part 1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s