VTP Commands
show vtp interface []
show vtp interface [<interface_range>]
import requests
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 vtp interface port-channel22",
"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)
{
"TABLE_vtp_interface": {
"ROW_vtp_interface": {
"if_index": "port-channel22",
"status": "Enabled"
}
}
}
switch# show vtp interface port-channel22 | xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:1.0:vtp" xmlns:nf="urn:ietf:param
s:xml:ns:netconf:base:1.0">
<nf:data>
<show>
<vtp>
<interface>
<__XML__OPT_Cmd_vtp_show_interface_interface_range>
<__XML__OPT_Cmd_vtp_show_interface___readonly__>
<__readonly__>
<TABLE_vtp_interface>
<ROW_vtp_interface>
<if_index>port-channel22</if_index>
<status>Enabled</status>
</ROW_vtp_interface>
</TABLE_vtp_interface>
</__readonly__>
</__XML__OPT_Cmd_vtp_show_interface___readonly__>
</__XML__OPT_Cmd_vtp_show_interface_interface_range>
</interface>
</vtp>
</show>
</nf:data>
</nf:rpc-reply>
]]>]]>
For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.
Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(1).
CLI Output |
---|
|
port-channel22 Enabled