show snapshots sections

show snapshots sections

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 snapshots sections",
  "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 snapshots sections",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_snapsection": {
            "ROW_snapsection": {
              "sectname": "v4route",
              "sectcmd": "show ip route detail vrf all",
              "sectrow": "ROW_prefix",
              "sectkey1": "ipprefix",
              "sectkey2": "-"
            }
          }
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snapshots sections command, see the CLI command reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show snapshots sections
user-specified snapshot sections
--------------------------------
[v4route]
show command: show ip route detail vrf all
row id: ROW_prefix
key1: ipprefix
key2: -

show snapshots compare before_maintenance after_maintenance

show snapshots compare before_maintenance after_maintenance

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 snapshots compare before_maintenance after_maintenance",
  "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 snapshots compare before_maintenance after_maintenance",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_feature": {
            "ROW_feature": [
              {
                "feat_name": "bgp",
                "TABLE_element": {
                  "ROW_element": [
                    {
                      "elemkey1": "vrf-name-out",
                      "elemval1": "default",
                      "elemkey3": "neighbor-id",
                      "elemval3": "10.1.1.1",
                      "TABLE_value": {
                        "ROW_value": {
                          "tag": "lastflap",
                          "val1": "P6DT18H12M32S",
                          "val2": "**P6DT18H19M19S**"
                        }
                      }
                    },
                    {
                      "elemkey1": "vrf-name-out",
                      "elemval1": "default",
                      "elemkey3": "neighbor-id",
                      "elemval3": "10.1.1.9",
                      "TABLE_value": {
                        "ROW_value": {
                          "tag": "lastflap",
                          "val1": "P6DT18H12M32S",
                          "val2": "**P6DT18H19M19S**"
                        }
                      }
                    },
                    {
                      "elemkey1": "vrf-name-out",
                      "elemval1": "default",
                      "elemkey3": "neighbor-id",
                      "elemval3": "193.168.1.2",
                      "TABLE_value": {
                        "ROW_value": {
                          "tag": "lastflap",
                          "val1": "P6DT18H12M32S",
                          "val2": "**P6DT18H19M19S**"
                        }
                      }
                    }
                  ]
                }
              },
              {
                "feat_name": "interface",
                "TABLE_element": {
                  "ROW_element": [
                    {
                      "elemkey1": "interface",
                      "elemval1": "mgmt0",
                      "TABLE_value": {
                        "ROW_value": [
                          {
                            "tag": "vdc_lvl_in_avg_bits",
                            "val1": "888",
                            "val2": "**952**"
                          },
                          {
                            "tag": "vdc_lvl_out_avg_bits",
                            "val1": "32",
                            "val2": "**56**"
                          },
                          {
                            "tag": "vdc_lvl_in_pkts",
                            "val1": "1127251",
                            "val2": "**1127909**"
                          },
                          {
                            "tag": "vdc_lvl_in_ucast",
                            "val1": "13211",
                            "val2": "**13225**"
                          },
                          {
                            "tag": "vdc_lvl_in_mcast",
                            "val1": "758816",
                            "val2": "**759333**"
                          },
                          {
                            "tag": "vdc_lvl_in_bcast",
                            "val1": "355224",
                            "val2": "**355351**"
                          },
                          {
                            "tag": "vdc_lvl_in_bytes",
                            "val1": "79815718",
                            "val2": "**79863829**"
                          },
                          {
                            "tag": "vdc_lvl_out_pkts",
                            "val1": "27129",
                            "val2": "**27147**"
                          },
                          {
                            "tag": "vdc_lvl_out_ucast",
                            "val1": "17290",
                            "val2": "**17302**"
                          },
                          {
                            "tag": "vdc_lvl_out_mcast",
                            "val1": "9825",
                            "val2": "**9831**"
                          },
                          {
                            "tag": "vdc_lvl_out_bytes",
                            "val1": "6467790",
                            "val2": "**6471477**"
                          }
                        ]
                      }
                    },
                    {
                      "elemkey1": "interface",
                      "elemval1": "Ethernet1/1",
                      "TABLE_value": {
                        "ROW_value": [
                          {
                            "tag": "eth_inrate1_bits",
                            "val1": "3648",
                            "val2": "**4272**"
                          },
                          {
                            "tag": "eth_outrate1_bits",
                            "val1": "416",
                            "val2": "**288**"
                          },
                          {
                            "tag": "eth_inrate1_summary_bits",
                            "val1": "3.65 Kbps",
                            "val2": "**4.27 Kbps**"
                          },
                          {
                            "tag": "eth_outrate1_summary_bits",
                            "val1": "416 bps",
                            "val2": "**288 bps**"
                          },
                          {
                            "tag": "eth_inrate2_bits",
                            "val1": "3104",
                            "val2": "**3120**"
                          },
                          {
                            "tag": "eth_inrate2_summary_bits",
                            "val1": "3.10 Kbps",
                            "val2": "**3.12 Kbps**"
                          },
                          {
                            "tag": "eth_inmcast",
                            "val1": "193399",
                            "val2": "**193532**"
                          },
                          {
                            "tag": "eth_inpkts",
                            "val1": "193399",
                            "val2": "**193532**"
                          },
                          {
                            "tag": "eth_inbytes",
                            "val1": "206936930",
                            "val2": "**207079240**"
                          },
                          {
                            "tag": "eth_outmcast",
                            "val1": "324056",
                            "val2": "**324279**"
                          },
                          {
                            "tag": "eth_outpkts",
                            "val1": "324056",
                            "val2": "**324279**"
                          },
                          {
                            "tag": "eth_outbytes",
                            "val1": "27105686",
                            "val2": "**27124296**"
                          }
                        ]
                      }
                    },
                    {
                      "elemkey1": "interface",
                      "elemval1": "Ethernet1/47",
                      "TABLE_value": {
                        "ROW_value": [
                          {
                            "tag": "eth_outrate1_bits",
                            "val1": "264",
                            "val2": "**144**"
                          },
                          {
                            "tag": "eth_outrate1_summary_bits",
                            "val1": "264 bps",
                            "val2": "**144 bps**"
                          },
                          {
                            "tag": "eth_inmcast",
                            "val1": "304493",
                            "val2": "**304703**"
                          },
                          {
                            "tag": "eth_inpkts",
                            "val1": "304493",
                            "val2": "**304703**"
                          },
                          {
                            "tag": "eth_inbytes",
                            "val1": "21314816",
                            "val2": "**21329558**"
                          },
                          {
                            "tag": "eth_outmcast",
                            "val1": "29384",
                            "val2": "**29404**"
                          },
                          {
                            "tag": "eth_outpkts",
                            "val1": "29384",
                            "val2": "**29404**"
                          },
                          {
                            "tag": "eth_outbytes",
                            "val1": "8295406",
                            "val2": "**8301058**"
                          }
                        ]
                      }
                    },
                    {
                      "elemkey1": "interface",
                      "elemval1": "Ethernet1/49",
                      "TABLE_value": {
                        "ROW_value": [
                          {
                            "tag": "eth_outrate1_bits",
                            "val1": "264",
                            "val2": "**144**"
                          },
                          {
                            "tag": "eth_outrate1_summary_bits",
                            "val1": "264 bps",
                            "val2": "**144 bps**"
                          },
                          {
                            "tag": "eth_inmcast",
                            "val1": "304491",
                            "val2": "**304701**"
                          },
                          {
                            "tag": "eth_inpkts",
                            "val1": "304491",
                            "val2": "**304701**"
                          },
                          {
                            "tag": "eth_inbytes",
                            "val1": "21314688",
                            "val2": "**21329430**"
                          },
                          {
                            "tag": "eth_outmcast",
                            "val1": "29388",
                            "val2": "**29408**"
                          },
                          {
                            "tag": "eth_outpkts",
                            "val1": "29388",
                            "val2": "**29408**"
                          },
                          {
                            "tag": "eth_outbytes",
                            "val1": "8295875",
                            "val2": "**8301527**"
                          }
                        ]
                      }
                    }
                  ]
                }
              },
              {
                "feat_name": "route-summary",
                "TABLE_element": {
                  "ROW_element": {
                    "elemkey1": "vrf-name-out",
                    "elemval1": "management",
                    "elemkey3": "addrf",
                    "elemval3": "ipv4",
                    "TABLE_subrow": {
                      "ROW_subrow": [
                        {
                          "subrowkey": "clientname",
                          "subrowval": "/",
                          "TABLE_subvalue": {
                            "ROW_subvalue": [
                              {
                                "tag": "clientnameuni",
                                "val1": "local",
                                "val2": "**am**"
                              },
                              {
                                "tag": "best-paths",
                                "val1": "1",
                                "val2": "**9**"
                              }
                            ]
                          }
                        },
                        {
                          "subrowkey": "clientname",
                          "subrowval": "/",
                          "TABLE_subvalue": {
                            "ROW_subvalue": [
                              {
                                "tag": "clientnameuni",
                                "val1": "direct",
                                "val2": "**am**"
                              },
                              {
                                "tag": "best-paths",
                                "val1": "1",
                                "val2": "**9**"
                              }
                            ]
                          }
                        },
                        {
                          "subrowkey": "clientname",
                          "subrowval": "/",
                          "TABLE_subvalue": {
                            "ROW_subvalue": [
                              {
                                "tag": "clientnameuni",
                                "val1": "static",
                                "val2": "**am**"
                              },
                              {
                                "tag": "best-paths",
                                "val1": "1",
                                "val2": "**9**"
                              }
                            ]
                          }
                        },
                        {
                          "subrowkey": "clientname",
                          "subrowval": "/",
                          "TABLE_subvalue": {
                            "ROW_subvalue": [
                              {
                                "tag": "clientnameuni",
                                "val1": "broadcast",
                                "val2": "**am**"
                              },
                              {
                                "tag": "best-paths",
                                "val1": "5",
                                "val2": "**9**"
                              }
                            ]
                          }
                        }
                      ]
                    }
                  }
                }
              },
              {
                "feat_name": "routev6-summary",
                "TABLE_element": {
                  "ROW_element": {
                    "elemkey1": "vrf-name-out",
                    "elemval1": "default",
                    "elemkey3": "addrf",
                    "elemval3": "ipv6",
                    "TABLE_subrow": {
                      "ROW_subrow": {
                        "subrowkey": "clientname",
                        "subrowval": "/",
                        "TABLE_subvalue": {
                          "ROW_subvalue": [
                            {
                              "tag": "clientnameuni",
                              "val1": "discard",
                              "val2": "**local**"
                            },
                            {
                              "tag": "best-paths",
                              "val1": "2",
                              "val2": "**1**"
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            ]
          }
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snapshots compare before_maintenance after_maintenance command, see the CLI command reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show snapshots compare before_maintenance after_maintenance


Feature             Tag            before_maintenance after_maintenance
[bgp] -------------------------------------------------------------------------------- [vrf-name-out:default] [neighbor-id:10.1.1.1] lastflap P6DT18H12M32S P6DT18H19M19S [vrf-name-out:default] [neighbor-id:10.1.1.9] lastflap P6DT18H12M32S P6DT18H19M19S [vrf-name-out:default] [neighbor-id:193.168.1.2] lastflap P6DT18H12M32S P6DT18H19M19S [interface] -------------------------------------------------------------------------------- [interface:mgmt0] vdc_lvl_in_avg_bits 888 952
vdc_lvl_out_avg_bits 32 56
vdc_lvl_in_pkts 1127251 1127909
vdc_lvl_in_ucast 13211 13225
vdc_lvl_in_mcast 758816 759333
vdc_lvl_in_bcast 355224 355351
vdc_lvl_in_bytes 79815718 79863829
vdc_lvl_out_pkts 27129 27147
vdc_lvl_out_ucast 17290 17302
vdc_lvl_out_mcast 9825 9831
vdc_lvl_out_bytes 6467790 6471477
[interface:Ethernet1/1] eth_inrate1_bits 3648 4272
eth_outrate1_bits 416 288
eth_inrate1_summary_bits 3.65 Kbps 4.27 Kbps
eth_outrate1_summary_bits 416 bps 288 bps
eth_inrate2_bits 3104 3120
eth_inrate2_summary_bits 3.10 Kbps 3.12 Kbps
eth_inmcast 193399 193532
eth_inpkts 193399 193532
eth_inbytes 206936930 207079240
eth_outmcast 324056 324279
eth_outpkts 324056 324279
eth_outbytes 27105686 27124296
[interface:Ethernet1/47] eth_outrate1_bits 264 144
eth_outrate1_summary_bits 264 bps 144 bps
eth_inmcast 304493 304703
eth_inpkts 304493 304703
eth_inbytes 21314816 21329558
eth_outmcast 29384 29404
eth_outpkts 29384 29404
eth_outbytes 8295406 8301058
[interface:Ethernet1/49] eth_outrate1_bits 264 144
eth_outrate1_summary_bits 264 bps 144 bps
eth_inmcast 304491 304701
eth_inpkts 304491 304701
eth_inbytes 21314688 21329430
eth_outmcast 29388 29408
eth_outpkts 29388 29408 eth_outbytes 8295875 8301527 [route-summary] -------------------------------------------------------------------------------- [vrf-name-out:management] [addrf:ipv4] [clientname:] clientnameuni local am best-paths 1 9 [clientname:] clientnameuni direct am best-paths 1 9 [clientname:] clientnameuni static am best-paths 1 9 [clientname:] clientnameuni broadcast am best-paths 5 9 [routev6-summary] -------------------------------------------------------------------------------- [vrf-name-out:default] [addrf:ipv6] [clientname:] clientnameuni discard local best-paths

show snapshots compare before_maint after_maint summary

show snapshots compare before_maint after_maint summary

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 snapshots compare before_maint after_maint summary",
  "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 snapshots compare before_maint after_maint summary",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_summary": {
            "ROW_summary": [
              {
                "item_desc": "# of interfaces",
                "summary_val1": "103",
                "summary_val2": "103"
              },
              {
                "item_desc": "# of vlans",
                "summary_val1": "1",
                "summary_val2": "1"
              },
              {
                "item_desc": "# of ipv4 routes vrf default",
                "summary_val1": "3",
                "summary_val2": "3"
              },
              {
                "item_desc": "# of ipv4 paths  vrf default",
                "summary_val1": "3",
                "summary_val2": "3"
              },
              {
                "item_desc": "# of ipv4 routes vrf management",
                "summary_val1": "20",
                "summary_val2": "20"
              },
              {
                "item_desc": "# of ipv4 paths  vrf management",
                "summary_val1": "20",
                "summary_val2": "20"
              },
              {
                "item_desc": "# of ipv6 routes vrf default",
                "summary_val1": "3",
                "summary_val2": "3"
              },
              {
                "item_desc": "# of ipv6 paths  vrf default",
                "summary_val1": "3",
                "summary_val2": "3"
              },
              {
                "item_desc": "# of eth interfaces",
                "summary_val1": "102",
                "summary_val2": "102"
              },
              {
                "item_desc": "# of eth interfaces up",
                "summary_val1": "0",
                "summary_val2": "0"
              },
              {
                "item_desc": "# of eth interfaces down",
                "summary_val1": "102",
                "summary_val2": "102"
              },
              {
                "item_desc": "# of eth interfaces other",
                "summary_val1": "0",
                "summary_val2": "0"
              },
              {
                "item_desc": "# of vlan interfaces",
                "summary_val1": "1",
                "summary_val2": "1"
              },
              {
                "item_desc": "# of vlan interfaces up",
                "summary_val1": "0",
                "summary_val2": "0"
              },
              {
                "item_desc": "# of vlan interfaces down",
                "summary_val1": "1",
                "summary_val2": "1"
              },
              {
                "item_desc": "# of vlan interfaces other",
                "summary_val1": "0",
                "summary_val2": "0"
              }
            ]
          }
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snapshots compare before_maint after_maint summary command, see the CLI command reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch#  show snapshots compare before_maint after_maint summary


Feature                            before_maint      after_maint    changed

basic summary
  # of interfaces                        103             103
  # of vlans                               1               1
  # of ipv4 routes vrf default             3               3
  # of ipv4 paths  vrf default             3               3
  # of ipv4 routes vrf management         20              20
  # of ipv4 paths  vrf management         20              20
  # of ipv6 routes vrf default             3               3
  # of ipv6 paths  vrf default             3               3

interfaces
  # of eth interfaces                    102             102
  # of eth interfaces up                   0               0
  # of eth interfaces down               102             102
  # of eth interfaces other                0               0

  # of vlan interfaces                     1               1
  # of vlan interfaces up                  0               0
  # of vlan interfaces down                1               1
  # of vlan interfaces other               0               0




show snapshots compare before_maintenance after_maintenance ipv4

show snapshots compare before_maintenance after_maintenance ipv4

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 snapshots compare before_maintenance after_maintenance ipv4",
  "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 snapshots compare before_maintenance after_maintenance ipv4",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_summary": {
            "ROW_summary": {
              "item_desc": "# of ipv4 routes",
              "summary_val1": "16",
              "summary_val2": "16"
            }
          }
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snapshots compare before_maintenance after_maintenance ipv4 command, see the CLI command reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show snapshots compare before_maintenance after_maintenance ipv4


metric                          before_maintenanceafter_maintenance changed

  # of ipv4 routes                        16              16