Management, Automation, and Analytics
Cisco Nexus One represents a paradigm shift — an open, unified management plane that integrates silicon, systems, software, operating model with security and observability at every layer. On-premises-managed Cisco Nexus Dashboard transforms data-center network operations with simplicity, automation, and analytics all using a single platform with a unified API.
What can you do with the Nexus Dashboard API?
Nexus Dashboard Infrastructure
Nexus Dashboard
Cisco Nexus Dashboard is a unified, single-pane-of-glass management platform designed to automate, orchestrate, and analyze modern data center across Cisco ACI, Data Center and Campus VXLAN EVPN, AI, Routed, and IP Fabric for Media (IPFM) fabrics. The platform enables the acceleration of NetOps and DevOps capabilities aligning seamlessly with third-party ecosystem tools from RedHat Ansible, HashiCorp Terraform, Splunk, and other integrations.
Getting started
Log in using a Python script or the cURL command to retrieve the authentication token.
Before sending requests to perform operations on the Nexus Dashboard cluster or services, log in with a POST request that includes a username, password, and login domain for an existing Nexus Dashboard user. The returned authorization token can be used in subsequent API calls. The domain value in the payload, for example "local", must match the configured authentication domain in your Nexus Dashboard environment.
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)
base_url = 'https://<nd-node-ip>'
payload = {
"userName": "admin",
"userPasswd": "cisco.123",
"domain": "local"
}
# Using a session to persist cookies across requests
with requests.Session() as session:
# Use verify=False if you are sure the target system is the system you expect and it has a self-signed certificate.
login_response = session.post(url=f"{base_url}/api/v1/infra/login", json=payload, verify=False)
print('Login Response:')
print(login_response.json())
print('\n-----------------------------------\n')
print('Session cookies after login:')
print(session.cookies.get_dict())
Use the cURL command to query the ND Authentication API and print the JSON response using the following command line example:
curl --insecure --request POST 'https://<nd-node-ip>/api/v1/infra/login' \
--data '{"domain": "local", "userName": "admin", "userPasswd": "cisco.123"}'
Extract the authentication token from the response payload. The token typically has a validity period of 20 minutes and may need to be refreshed or re-obtained for long-running sessions.
The login response includes the authentication token, account login information, and RBAC privileges. Use the returned token as the AuthCookie value, or retain the session cookie when using a requests session, for subsequent API calls.
{
"jwttoken": "eyJhbGciOiJSUzI1NiIsImtpZCI6InFieXViN2hldndqM2o0YnZrdGp5NDY1c2NkcGRicmRzIiwidHlwIjoiSldUIn0.eyJhdnBhaXIiOiJzaGVsbDpkb21haW5zPWFsbC9zdXBlci1hZG1pbiIsImNsdXN0ZXIiOiI1NDRkNDUyZC00ZTQ0LTJkMzAtMzEwMC0wMDAwMDAwMDAwMDAiLCJleHAiOjE3NjE2MTQzMjEsImlhdCI6MTc2MTYxMzEyMSwiaWQiOiI0OGQxMDViZGZiYzQ5YTVmY2YzOWExMGI5NjEzODZlNjFkZmU0MDA4NWNiMDMxNWQ4MThiNzYxYzU3MzVkYWZhIiwiaXNzIjoibmQiLCJpc3MtaG9zdCI6IjEwLjE1LjAuMTQzIiwicmJhYyI6W3siZG9tYWluIjoiYWxsIiwicm9sZXNNYXAiOnsic3VwZXItYWRtaW4iOnt9fX1dLCJzZXNzaW9uaWQiOiIzb3h0OW5JcmJRcURmeVJOPWZVbENmYlAiLCJ1c2VyZmxhZ3MiOjAsInVzZXJpZCI6MjUwMDIsInVzZXJuYW1lIjoiYWRtaW4iLCJ1c2VydHlwZSI6ImxvY2FsIn0.P9C0fXsGsQjMDCdx4J_UdJAqAzSkSP7cTW4u-vDF-n0f8KgBDET_KUSC0HcBvx9ZRiKHlUoKpMG5n61sBYUB2moCLfPLXW14a0ThIGSJXYgtT5hoRDacLhFoMEya5L2gqG-q0sNf-5DUtsb7kHt1KwHzz8WYLpxrTD0-nyJlIOLROUYAm-HaT14Bn1hUDW-Eq7wUqVvghEwDffJKrj4OlkNztgYTR7Yi74WucydIdjjzqatW7u-CzAF3YHHMXNU3WpGzkEG_izuk5i-SfwzoDGKUsQMRNNe8t6MNiKzehW564b33AgWR8J3-RqR-bRuBth-tHRCdDcoaCsr8chh50g",
"username": "admin",
"usertype": "local",
"rbac": "[{\"domain\":\"all\",\"rolesMap\":{\"super-admin\":{}}}]",
"statusCode": 200,
"token": "eyJhbGciOiJSUzI1NiIsImtpZCI6InFieXViN2hldndqM2o0YnZrdGp5NDY1c2NkcGRicmRzIiwidHlwIjoiSldUIn0.eyJhdnBhaXIiOiJzaGVsbDpkb21haW5zPWFsbC9zdXBlci1hZG1pbiIsImNsdXN0ZXIiOiI1NDRkNDUyZC00ZTQ0LTJkMzAtMzEwMC0wMDAwMDAwMDAwMDAiLCJleHAiOjE3NjE2MTQzMjEsImlhdCI6MTc2MTYxMzEyMSwiaWQiOiI0OGQxMDViZGZiYzQ5YTVmY2YzOWExMGI5NjEzODZlNjFkZmU0MDA4NWNiMDMxNWQ4MThiNzYxYzU3MzVkYWZhIiwiaXNzIjoibmQiLCJpc3MtaG9zdCI6IjEwLjE1LjAuMTQzIiwicmJhYyI6W3siZG9tYWluIjoiYWxsIiwicm9sZXNNYXAiOnsic3VwZXItYWRtaW4iOnt9fX1dLCJzZXNzaW9uaWQiOiIzb3h0OW5JcmJRcURmeVJOPWZVbENmYlAiLCJ1c2VyZmxhZ3MiOjAsInVzZXJpZCI6MjUwMDIsInVzZXJuYW1lIjoiYWRtaW4iLCJ1c2VydHlwZSI6ImxvY2FsIn0.P9C0fXsGsQjMDCdx4J_UdJAqAzSkSP7cTW4u-vDF-n0f8KgBDET_KUSC0HcBvx9ZRiKHlUoKpMG5n61sBYUB2moCLfPLXW14a0ThIGSJXYgtT5hoRDacLhFoMEya5L2gqG-q0sNf-5DUtsb7kHt1KwHzz8WYLpxrTD0-nyJlIOLROUYAm-HaT14Bn1hUDW-Eq7wUqVvghEwDffJKrj4OlkNztgYTR7Yi74WucydIdjjzqatW7u-CzAF3YHHMXNU3WpGzkEG_izuk5i-SfwzoDGKUsQMRNNe8t6MNiKzehW564b33AgWR8J3-RqR-bRuBth-tHRCdDcoaCsr8chh50g"
}
Optionally, you can extract the token into a variable to simplify future calls, for example:
token = login_response.json().get("jwttoken") or login_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
Orchestrator
Manage & Automate