show diagnostic content module all
Python
Copy
import json

"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'

myheaders={'content-type':'application/json'}
payload={
  "ins_api":{
  "version": "1.0",
  "type": "cli_show",
  "chunk": "0",
  "sid": "1",
  "input": "show diagnostic content module all",
  "output_format": "json"
}

response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)


{

  "ins_api": {
    "type": "cli_show",
    "version": "1.0",
    "sid": "eoc",
    "outputs": {
      "output": {
        "input": "show diagnostic content module all",
        "msg": "Success",
        "code": "200",
        "body": {
          "attr_descr": "Diagnostics test suite attributes: \nB/C/* - Bypass bootup level test / Complete bootup level test / NA \nP/*   - Per port test / NA \nM/S/* - Only applicable to active / standby unit / NA \nD/N/* - Disruptive test / Non-disruptive test / NA \nH/O/* - Always enabled monitoring test / Conditionally enabled test / NA \nF/*   - Fixed monitoring interval test / NA \nX/*   - Not a health monitoring test / NA \nE/*   - Sup to line card test / NA \nL/*   - Exclusively run this test / NA \nT/*   - Not an ondemand test / NA \nA/I/* - Monitoring is active / Monitoring is inactive / NA",
          "TABLE_Module": {
            "ROW_Module": {
              "module_id": "1",
              "module_type": "48x10GT + 6x40G/100G Ethernet Module (Active)",
              "TABLE_test": {
                "ROW_test": [
                  {
                    "test_id": "1",
                    "testname": "USB",
                    "test_attr": "C**N**X**T*",
                    "test_interval": "-NA-"
                  },
                  {
                    "test_id": "2",
                    "testname": "NVRAM",
                    "test_attr": "***N******A",
                    "test_interval": "00:05:00"
                  },
                  {
                    "test_id": "3",
                    "testname": "RealTimeClock",
                    "test_attr": "***N******A",
                    "test_interval": "00:05:00"
                  },
                  {
                    "test_id": "4",
                    "testname": "PrimaryBootROM",
                    "test_attr": "***N******A",
                    "test_interval": "00:30:00"
                  },
                  {
                    "test_id": "5",
                    "testname": "SecondaryBootROM",
                    "test_attr": "***N******A",
                    "test_interval": "00:30:00"
                  },
                  {
                    "test_id": "6",
                    "testname": "BootFlash",
                    "test_attr": "***N******A",
                    "test_interval": "00:30:00"
                  },
                  {
                    "test_id": "7",
                    "testname": "SystemMgmtBus",
                    "test_attr": "**MN******A",
                    "test_interval": "00:00:30"
                  },
                  {
                    "test_id": "8",
                    "testname": "OBFL",
                    "test_attr": "C**N**X**T*",
                    "test_interval": "-NA-"
                  },
                  {
                    "test_id": "9",
                    "testname": "ACT2",
                    "test_attr": "***N******A",
                    "test_interval": "00:30:00"
                  },
                  {
                    "test_id": "10",
                    "testname": "Console",
                    "test_attr": "***N******A",
                    "test_interval": "00:00:30"
                  },
                  {
                    "test_id": "11",
                    "testname": "FpgaRegTest",
                    "test_attr": "***N******A",
                    "test_interval": "00:00:30"
                  },
                  {
                    "test_id": "12",
                    "testname": "Mce",
                    "test_attr": "***N******A",
                    "test_interval": "01:00:00"
                  },
                  {
                    "test_id": "13",
                    "testname": "AsicMemory",
                    "test_attr": "C**D**X**T*",
                    "test_interval": "-NA-"
                  },
                  {
                    "test_id": "14",
                    "testname": "Pcie",
                    "test_attr": "C**N**X**T*",
                    "test_interval": "-NA-"
                  },
                  {
                    "test_id": "15",
                    "testname": "PortLoopback",
                    "test_attr": "*P*N**XE***",
                    "test_interval": "-NA-"
                  },
                  {
                    "test_id": "16",
                    "testname": "L2ACLRedirect",
                    "test_attr": "*P*N***E**A",
                    "test_interval": "00:01:00"
                  },
                  {
                    "test_id": "17",
                    "testname": "BootupPortLoopback",
                    "test_attr": "CP*N**XE*T*",
                    "test_interval": "-NA-"
                  }
                ]
              }
            }
          }
        }
      }
    }
  }
}