show vpc brief

show vpc brief

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 vpc brief",
  "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": {
        "outputs": {
            "output": {
                "body": {
                    "TABLE_peerlink": {
                        "ROW_peerlink": {
                            "peer-link-id": "1", 
                            "peer-link-port-state": "1", 
                            "peer-up-vlan-bitset": "35-37,100-101,104-105", 
                            "peerlink-ifindex": "Po2"
                        }
                    }, 
                    "TABLE_vpc": {
                        "ROW_vpc": [
                            {
                                "es-attr": "DF: Invalid", 
                                "phy-port-if-removed": "disabled", 
                                "up-vlan-bitset": "35,100-101,105", 
                                "vpc-consistency": "consistent", 
                                "vpc-consistency-status": "SUCCESS", 
                                "vpc-id": "35", 
                                "vpc-ifindex": "Po101", 
                                "vpc-port-state": "1", 
                                "vpc-thru-peerlink": "0"
                            }, 
                            {
                                "es-attr": "DF: Invalid", 
                                "phy-port-if-removed": "disabled", 
                                "up-vlan-bitset": "-", 
                                "vpc-consistency": "consistent", 
                                "vpc-consistency-status": "SUCCESS", 
                                "vpc-id": "36", 
                                "vpc-ifindex": "Po36", 
                                "vpc-port-state": "0", 
                                "vpc-thru-peerlink": "1"
                            }, 
                            {
                                "es-attr": "DF: Invalid", 
                                "phy-port-if-removed": "disabled", 
                                "up-vlan-bitset": "36,100-101,104", 
                                "vpc-consistency": "consistent", 
                                "vpc-consistency-status": "SUCCESS", 
                                "vpc-id": "100", 
                                "vpc-ifindex": "Po100", 
                                "vpc-port-state": "1", 
                                "vpc-thru-peerlink": "0"
                            }
                        ]
                    }, 
                    "dual-active-excluded-vlans": "-", 
                    "num-of-vpcs": "3", 
                    "operational-l3-peer": "Disabled", 
                    "peer-gateway": "0", 
                    "vpc-auto-recovery-status": "Disabled", 
                    "vpc-delay-restore-status": "Timer is off.(timeout = 30s)", 
                    "vpc-delay-restore-svi-status": "Timer is off.(timeout = 10s)", 
                    "vpc-domain-id": "2", 
                    "vpc-end": [
                        "End of table", 
                        "End of table"
                    ], 
                    "vpc-graceful-consistency-check-status": "enabled", 
                    "vpc-hdr": "Start of vPC table", 
                    "vpc-not-es": "vPC complex", 
                    "vpc-peer-consistency": "consistent", 
                    "vpc-peer-consistency-status": "SUCCESS", 
                    "vpc-peer-keepalive-status": "peer-alive", 
                    "vpc-peer-link-hdr": "Start of VPC peer-link table", 
                    "vpc-peer-status": "peer-ok", 
                    "vpc-peer-status-reason": "SUCCESS", 
                    "vpc-per-vlan-peer-consistency": "consistent", 
                    "vpc-role": "primary-secondary", 
                    "vpc-type-2-consistency": "inconsistent", 
                    "vpc-type-2-consistency-status": "INVALID"
                }, 
                "code": "200", 
                "input": "show vpc brief", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

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

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

CLI Output
Switch# show vpc brief
Legend:
                () - local vPC is down, forwarding via vPC peer-link

vPC domain id                     : 2
Peer status : peer adjacency formed ok
vPC keep-alive status : peer is alive
Configuration consistency status : success Per-vlan consistency status : success
Type-2 consistency status : failed
Type-2 inconsistency reason : QoSMgr Qos configuration incompatible vPC role : primary, operational secondary Number of vPCs configured : 3
Peer Gateway : Disabled Dual-active excluded VLANs : - Graceful Consistency Check : Enabled Auto-recovery status : Disabled Delay-restore status : Timer is off.(timeout = 30s) Delay-restore SVI status : Timer is off.(timeout = 10s) Operational Layer3 Peer-router : Disabled vPC Peer-link status --------------------------------------------------------------------- id Port Status Active vlans
-- ---- ------ ------------------------------------------------- 1 Po2 up 35-37,100-101,104-105
vPC status ---------------------------------------------------------------------------- Id Port Status Consistency Reason Active vlans -- ------------ ------ ----------- ------ --------------- 35 Po101 up success success 35,100-101,105
36 Po36 down
success success -
100 Po100 up success success 36,100-101,104
Please check "show vpc consistency-parameters vpc vpc-num " for the consistency reason of down vpc and for type-2 consistency reasons for any vpc.

show vpc consistency-parameters global

show vpc consistency-parameters global

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 vpc consistency-parameters global",
  "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": {
        "outputs": {
            "output": {
                "body": {
                    "TABLE_vpc_consistency": {
                        "ROW_vpc_consistency": [
                            {
                                "vpc-param-local-val": "Enabled", 
                                "vpc-param-name": "STP MST Simulate PVST", 
                                "vpc-param-peer-val": "Enabled", 
                                "vpc-param-type": "1"
                            }, 
                            {
                                "vpc-param-local-val": "Normal, Disabled, Disabled", 
                                "vpc-param-name": "STP Port Type, Edge BPDUFilter, Edge BPDUGuard", 
                                "vpc-param-peer-val": "Normal, Disabled, Disabled", 
                                "vpc-param-type": "1"
                            }, 
                            {
                                "vpc-param-local-val": "\"\"", 
                                "vpc-param-name": "STP MST Region Name", 
                                "vpc-param-peer-val": "\"\"", 
                                "vpc-param-type": "1"
                            }, 
                            {
                                "vpc-param-local-val": "None", 
                                "vpc-param-name": "STP Disabled", 
                                "vpc-param-peer-val": "None", 
                                "vpc-param-type": "1"
                            }, 
                            {
                                "vpc-param-local-val": "Rapid-PVST", 
                                "vpc-param-name": "STP Mode", 
                                "vpc-param-peer-val": "Rapid-PVST", 
                                "vpc-param-type": "1"
                            }, 
                            {
                                "vpc-param-local-val": "Enabled", 
                                "vpc-param-name": "STP Bridge Assurance", 
                                "vpc-param-peer-val": "Enabled", 
                                "vpc-param-type": "1"
                            }, 
                            {
                                "vpc-param-local-val": "Disabled", 
                                "vpc-param-name": "STP Loopguard", 
                                "vpc-param-peer-val": "Disabled", 
                                "vpc-param-type": "1"
                            }, 
                            {
                                "vpc-param-local-val": "", 
                                "vpc-param-name": "STP MST Region Instance to VLAN Mapping", 
                                "vpc-param-peer-val": "", 
                                "vpc-param-type": "1"
                            }, 
                            {
                                "vpc-param-local-val": "0", 
                                "vpc-param-name": "STP MST Region Revision", 
                                "vpc-param-peer-val": "0", 
                                "vpc-param-type": "1"
                            }, 
                            {
                                "vpc-param-local-val": "100-101,104-105", 
                                "vpc-param-name": "Interface-vlan admin up", 
                                "vpc-param-peer-val": "100-101,104-105", 
                                "vpc-param-type": "2"
                            }, 
                            {
                                "vpc-param-local-val": "100-101,104-105", 
                                "vpc-param-name": "Interface-vlan routing capability", 
                                "vpc-param-peer-val": "100-101,104-105", 
                                "vpc-param-type": "2"
                            }, 
                            {
                                "vpc-param-local-val": "", 
                                "vpc-param-name": "Xconnect Vlans", 
                                "vpc-param-peer-val": "", 
                                "vpc-param-type": "1"
                            }, 
                            {
                                "vpc-param-local-val": "([0-7], [], [], [], [], [])", 
                                "vpc-param-name": "QoS (Cos)", 
                                "vpc-param-peer-val": "([0,4-7], [1], [2], [3], [], [])", 
                                "vpc-param-type": "2"
                            }, 
                            {
                                "vpc-param-local-val": "(1500, 1500, 1500, 1500, 1500, 1500)", 
                                "vpc-param-name": "Network QoS (MTU)", 
                                "vpc-param-peer-val": "(1500, 1500, 1500, 1500, 1500, 1500)", 
                                "vpc-param-type": "2"
                            }, 
                            {
                                "vpc-param-local-val": "(F, F, F, F, F, F)", 
                                "vpc-param-name": "Network Qos (Pause: T->Enabled, F->Disabled)", 
                                "vpc-param-peer-val": "(F, F, F, F, F, F)", 
                                "vpc-param-type": "2"
                            }, 
                            {
                                "vpc-param-local-val": "(100, 0, 0, 0, 0, 0)", 
                                "vpc-param-name": "Input Queuing (Bandwidth)", 
                                "vpc-param-peer-val": "(100, 0, 0, 0, 0, 0)", 
                                "vpc-param-type": "2"
                            }, 
                            {
                                "vpc-param-local-val": "(F, F, F, F, F, F)", 
                                "vpc-param-name": "Input Queuing (Absolute Priority: T->Enabled, F->Disabled)", 
                                "vpc-param-peer-val": "(F, F, F, F, F, F)", 
                                "vpc-param-type": "2"
                            }, 
                            {
                                "vpc-param-local-val": "(100, 0, 0, 0, 0, 0)", 
                                "vpc-param-name": "Output Queuing (Bandwidth Remaining)", 
                                "vpc-param-peer-val": "(20, 0, 0, 0, 0, 0)", 
                                "vpc-param-type": "2"
                            }, 
                            {
                                "vpc-param-local-val": "(F, F, F, F, F, F)", 
                                "vpc-param-name": "Output Queuing (Absolute Priority: T->Enabled, F->Disabled)", 
                                "vpc-param-peer-val": "(F, F, F, F, F, F)", 
                                "vpc-param-type": "2"
                            }, 
                            {
                                "vpc-param-local-val": "warp", 
                                "vpc-param-name": "HW profile Forwarding Mode", 
                                "vpc-param-peer-val": "warp", 
                                "vpc-param-type": "1"
                            }, 
                            {
                                "vpc-param-local-val": "35-37,100-101,104-105", 
                                "vpc-param-name": "Allowed VLANs", 
                                "vpc-param-peer-val": "35-37,100-101,104-105", 
                                "vpc-param-type": "-"
                            }, 
                            {
                                "vpc-param-local-val": "-", 
                                "vpc-param-name": "Local suspended VLANs", 
                                "vpc-param-peer-val": "-", 
                                "vpc-param-type": "-"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show vpc consistency-parameters global", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show vpc consistency-parameters global command, see the CLI command reference:

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

CLI Output
Switch# show vpc consistency-parameters global

    Legend:
        Type 1 : vPC will be suspended in case of mismatch

Name                        Type  Local Value            Peer Value
------------- ---- ---------------------- ----------------------- STP MST Simulate PVST 1 Enabled Enabled
STP Port Type, Edge 1 Normal, Disabled, Normal, Disabled,
BPDUFilter, Edge BPDUGuard Disabled Disabled
STP MST Region Name 1 "" ""
STP Disabled 1 None None
STP Mode 1 Rapid-PVST Rapid-PVST
STP Bridge Assurance 1 Enabled Enabled
STP Loopguard 1 Disabled Disabled
STP MST Region Instance to 1
VLAN Mapping
STP MST Region Revision 1 0 0
Interface-vlan admin up 2 100-101,104-105 100-101,104-105
Interface-vlan routing 2 100-101,104-105 100-101,104-105
capability
Xconnect Vlans 1
QoS (Cos) 2 ([0-7], [], [], [], ([0,4-7], [1], [2],
[], []) [3], [], [])
Network QoS (MTU) 2 (1500, 1500, 1500, (1500, 1500, 1500,
1500, 1500, 1500) 1500, 1500, 1500)
Network Qos (Pause: 2 (F, F, F, F, F, F) (F, F, F, F, F, F)
T- Enabled, F- Disabled)
Input Queuing (Bandwidth) 2 (100, 0, 0, 0, 0, 0) (100, 0, 0, 0, 0, 0)
Input Queuing (Absolute 2 (F, F, F, F, F, F) (F, F, F, F, F, F)
Priority: T- Enabled,
F- Disabled)
Output Queuing (Bandwidth 2 (100, 0, 0, 0, 0, 0) (20, 0, 0, 0, 0, 0)
Remaining)
Output Queuing (Absolute 2 (F, F, F, F, F, F) (F, F, F, F, F, F)
Priority: T- Enabled,
F- Disabled)
HW profile Forwarding Mode 1 warp warp
Allowed VLANs - 35-37,100-101,104-105 35-37,100-101,104-105 Local suspended VLANs - - -