show install committed
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 install committed",
  "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 install committed",
        "msg": "Success",
        "code": "200",
        "body": {
          "curr_nxos_image": "bootflash:/nxos.9.2.1.bin-260-CCO",
          "TABLE_package_list": {
            "ROW_package_list": {
              "package_id": {}
            }
          },
          "TABLE_smu_list": {
            "ROW_smu_list": {
              "install_smu_id": "nxos.IGMP_RESTART-n9k_ALL-1.0.0-9.2.1.lib32_n9000\n"
            }
          }
        }
      }
    }
  }
}