Deploy, Build, and Automate
Nexus Dashboard provides a programmatic interface for visibility, site onboarding, and automation of networking configurations across Cisco Application Centric Infrastructure (ACI) and NX-OS fabrics, all using a single platform with a unified API.
What can you do with the Nexus Dashboard and Services API?
Nexus Dashboard Foundational
Nexus Dashboard
Cisco Nexus Dashboard transforms hybrid data center operations by providing a single pane of glass from which you can operate and manage your infrastructure. The intuitive Cisco Nexus Dashboard platform provides services such as Cisco Nexus Dashboard Insights, Cisco Nexus Dashboard Orchestrator, Cisco Nexus Dashboard Fabric Controller, and a single operational view of your geographically dispersed multicloud environments. The platform enables the acceleration of NetOps and DevOps capabilities while scaling into the cloud. And it aligns seamlessly with third-party ecosystem tools from HashiCorp Terraform, ServiceNow, and Splunk, with other integrations to come.
Getting started
Log in using a Python or the cURL command to retrieve the authentication token.
Before you can send any requests to perform specific operations on the Nexus Dashboard cluster or services, you must login by POSTing a JSON payload containing a username, password, and login domain for a user already configured in your Nexus Dashboard to obtain an authorization token that you can use in subsequent API calls.
Use Python requests to query the ND Authentication API and print the JSON response using the following code example:
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
url = 'https://[nd-node-ip]/login'
payload = {
"userName": "admin",
"userPasswd": "Cisco123!",
"domain": "DefaultAuth"
}
# Use verify=False if you are sure the target system is the system you expect and it has a self-signed certificate.
response = requests.post(url=url, json=payload, verify=False)
print(response.json())
Use the cURL command to query the ND Authentication API and print the JSON response using the following command line example:
curl -k --request POST 'https://[nd-node-ip]/login' \
--data-raw '{"userName": "admin","userPasswd":"Cisco123!","domain":"DefaultAuth"}'
Extract the authentication token from the response payload.
The standard login response payload contains the authentication token as well as the user's login information and RBAC privileges. You will need to use only the authentication token for the subsequent calls.
{
"jwttoken": "eyJhbGciOiJSUzI1NiIsImtpZCI6InliZTVvZjMzODFqcXphczZsZnZ5Y3c0MmlsOXZ3Ym9hIiwidHlwIjoiSldUIn0.eyJhdnBhaXIiOiJzaGVsbDpkb21haW5zPWFsbC9hZG1pbi8iLCJjbHVzdGVyIjoiNjQ2NTc2NjMtNmM3NS03Mzc0LTY1NzItMzEyZDMzMzIyZDMzIiwiZXhwIjoxNjQ0MzQzMjkzLCJpYXQiOjE2NDQzNDIwOTMsImlkIjoiNDhkMTA1YmRmYmM0OWE1ZmNmMzlhMTBiOTYxMzg2ZTYxZGZlNDAwODVjYjAzMTVkODE4Yjc2MWM1NzM1ZGFmYSIsImlzcyI6Im5kIiwiaXNzLWhvc3QiOiIxMC4zMC4xMS4zMiIsInJiYWMiOlt7ImRvbWFpbiI6ImFsbCIsInJvbGVzUiI6MTY3NzcyMTYsInJvbGVzVyI6MSwicm9sZXMiOltbImFkbWluIiwiV3JpdGVQcml2Il0sWyJhcHAtdXNlciIsIlJlYWRQcml2Il1dfV0sInNlc3Npb25pZCI6IkxIbUVVWW0zUjI3ZFNtVGRKOTdIN0lZQiIsInVzZXJmbGFncyI6MCwidXNlcmlkIjoyNTAwMiwidXNlcm5hbWUiOiJhZG1pbiIsInVzZXJ0eXBlIjoibG9jYWwifQ.JBC2b_tbE-ULqv7oQBY9I7tMI47IYDHr0loVtCD3Kd3V2TX6TGSI0W7UHtB27NxuKgVuUDa3s9CHpBlMuLe9u-RU8z6mmJAPofGmRcy33-kDq7DnFEQjcq2m41V3CPmYSYP7BrcGWi2evImGrSErkZAFWsIIcfqLJ20x8emczFFRr_Pvep0jkLtQCE6nrX1954EUvZl4Mu0WD_uQ25OdgdpRzsc1jnf2E4oWcrqoKiIah4Ai4wuVPi-NXhU5Fj8WpeX4MTjlXnQB3WKE5-3e-MyVQU_TgIAzqMs6h_dlJ9jyrhBDunXgigG1ztUY98dM39qQ6CImZVel9M3-sUrzSg",
"username": "admin",
"usertype": "local",
"rbac": "[{\"domain\":\"all\",\"rolesR\":16777216,\"rolesW\":1,\"roles\":[[\"admin\",\"WritePriv\"],[\"app-user\",\"ReadPriv\"]]}]",
"statusCode": 200,
"token": "eyJhbGciOiJSUzI1NiIsImtpZCI6InliZTVvZjMzODFqcXphczZsZnZ5Y3c0MmlsOXZ3Ym9hIiwidHlwIjoiSldUIn0.eyJhdnBhaXIiOiJzaGVsbDpkb21haW5zPWFsbC9hZG1pbi8iLCJjbHVzdGVyIjoiNjQ2NTc2NjMtNmM3NS03Mzc0LTY1NzItMzEyZDMzMzIyZDMzIiwiZXhwIjoxNjQ0MzQzMjkzLCJpYXQiOjE2NDQzNDIwOTMsImlkIjoiNDhkMTA1YmRmYmM0OWE1ZmNmMzlhMTBiOTYxMzg2ZTYxZGZlNDAwODVjYjAzMTVkODE4Yjc2MWM1NzM1ZGFmYSIsImlzcyI6Im5kIiwiaXNzLWhvc3QiOiIxMC4zMC4xMS4zMiIsInJiYWMiOlt7ImRvbWFpbiI6ImFsbCIsInJvbGVzUiI6MTY3NzcyMTYsInJvbGVzVyI6MSwicm9sZXMiOltbImFkbWluIiwiV3JpdGVQcml2Il0sWyJhcHAtdXNlciIsIlJlYWRQcml2Il1dfV0sInNlc3Npb25pZCI6IkxIbUVVWW0zUjI3ZFNtVGRKOTdIN0lZQiIsInVzZXJmbGFncyI6MCwidXNlcmlkIjoyNTAwMiwidXNlcm5hbWUiOiJhZG1pbiIsInVzZXJ0eXBlIjoibG9jYWwifQ.JBC2b_tbE-ULqv7oQBY9I7tMI47IYDHr0loVtCD3Kd3V2TX6TGSI0W7UHtB27NxuKgVuUDa3s9CHpBlMuLe9u-RU8z6mmJAPofGmRcy33-kDq7DnFEQjcq2m41V3CPmYSYP7BrcGWi2evImGrSErkZAFWsIIcfqLJ20x8emczFFRr_Pvep0jkLtQCE6nrX1954EUvZl4Mu0WD_uQ25OdgdpRzsc1jnf2E4oWcrqoKiIah4Ai4wuVPi-NXhU5Fj8WpeX4MTjlXnQB3WKE5-3e-MyVQU_TgIAzqMs6h_dlJ9jyrhBDunXgigG1ztUY98dM39qQ6CImZVel9M3-sUrzSg"
}
Optionally, you can extract the token into a variable to simplify future calls, for example:
token = response.json().get("token")
Use the authentication token with service-specific calls.
You can learn more about using the authentication token with service-specific calls from the following link.
Visibility & Analytics
Policy & Connectivity Automation
Fabric Management