Logging in

Logging in
POST http://<IP_Address>/api/aaaLogin.json
{
  "aaaUser": {
    "attributes": {
      "name": "testname",
      "pwd": "<password>"
}}}
{
  "aaaLogin": {
    "attributes": {
      "token": "LIOcWMWyt5MnetsbiVwnE1kfcxD+HrJZ4d8Nvgi5mW44ZyCDut2JDN+NHA27Uxlo04ZACO8hyaKV08DuYBL7f93EOSz9LuniPs9/8MQeHrwESUeEhw0M4Kp2LJMlxAjeuV7m0/gww0Fi4p8K9gsyKSFxi74od6ztLhKiDFjtxm0=",
      "siteFingerprint": "",
      "refreshTimeoutSeconds": "600",
      "guiIdleTimeoutSeconds": "1200",
      "restTimeoutSeconds": "0",
      "creationTime": "1435631774",
      "firstLoginTime": "1435631774",
      "userName": "admin",
      "remoteUser": "false",
      "unixUserId": "0",
      "sessionId": "90wv8IkXTMiiGhrztPUdyg==",
      "lastName": "",
      "firstName": "",
      "version": "0.9(14HEAD${version.patch})",
      "buildTime": "Tue Jun 23 04:05:41 PDT 2015"
    },
    "children": [
      {
        "aaaUserDomain": {
          "attributes": {
            "name": "all",
            "rolesR": "admin",
            "rolesW": "admin"
          },
          "children": [
            {
              "aaaReadRoles": {
                "attributes": {}
              }
            },
            {
              "aaaWriteRoles": {
                "attributes": {},
                "children": [
                  {
                    "role": {
                      "attributes": {
                        "name": "network-admin"
}}}}]}}]}}]}}]

This example demonstrates a user logging in.

Before you can issue any HTTP requests to configure the switch, you must issue an POST request to log into the switch. The aaaUser object is used to log into the switch.

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html