show switch-profile
show switch-profile
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 switch-profile",
"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 switch-profile",
"msg": "Success",
"code": "200",
"body": {
"profile_name": "test",
"cfg_rev": 1
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show switch-profile command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show switch-profile test buffer
show switch-profile test buffer
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 switch-profile test buffer",
"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 switch-profile test buffer",
"msg": "Success",
"code": "200",
"body": {
"prof-name": "test",
"TABLE_commands": {
"ROW_commands": [
{
"seq_no": "1",
"cmd": "interface Ethernet1/4"
},
{
"seq_no": "1.1",
"cmd": " switchport access vlan 22"
}
]
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show switch-profile test buffer command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show switch-profile test peer 10.77.143.233 details
show switch-profile test peer 10.77.143.233 details
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 switch-profile test peer 10.77.143.233 details",
"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 switch-profile test peer 10.77.143.233 details",
"msg": "Success",
"code": "200",
"body": {
"prof-name": "test",
"peer_address": "10.77.143.233",
"peer_sync_status": "In_sync",
"remote_status": "Commit_Success",
"remote_error": ""
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show switch-profile test peer 10.77.143.233 details command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show switch-profile test status
show switch-profile test status
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 switch-profile test status",
"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 switch-profile test status",
"msg": "Success",
"code": "200",
"body": {
"prof-name": "test",
"start_usec": 373899,
"start_time": "Fri Jul 27 09:21:05 2018",
"end_usec": 743620,
"end_time": "Fri Jul 27 09:21:07 2018",
"revision_number": 1,
"session_type": "Initial_Exchange",
"session_subtype": "Init_Exchange_All",
"peer_triggered": 0,
"profile_status": "Sync_Success",
"local_status": "Commit_Success",
"local_error": "",
"peer_address": "10.77.143.233",
"peer_sync_status": "In_sync",
"remote_status": "Commit_Success",
"remote_error": ""
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show switch-profile test status command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show switch-profile test session-history
show switch-profile test session-history
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 switch-profile test session-history",
"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 switch-profile test session-history",
"msg": "Success",
"code": "200",
"body": {
"prof-name": "test",
"TABLE_session": {
"ROW_session": [
{
"session_index": 1,
"start_usec": 830159,
"start_time": "Fri Jul 27 09:20:29 2018",
"end_usec": 193072,
"end_time": "Fri Jul 27 09:20:30 2018",
"revision_number": 1,
"session_type": "Initial_Exchange",
"session_subtype": "Init_Exchange_All",
"peer_triggered": 0,
"profile_status": "Merge_Failed",
"local_status": "Verify_Failure",
"local_error": "Peer 10.77.143.233 unable to accept lock request",
"peer_address": "10.77.143.233",
"peer_sync_status": "Not_yet_merged",
"merge_flags": "Merge Flags: pending_merge:1 rcv_merge:0 pend_validate:0",
"remote_status": "Verify_Failure",
"remote_error": "Global-db modification in progress"
},
{
"session_index": 2,
"start_usec": 363945,
"start_time": "Fri Jul 27 09:20:32 2018",
"end_usec": 577241,
"end_time": "Fri Jul 27 09:20:32 2018",
"revision_number": 1,
"session_type": "Initial_Exchange",
"session_subtype": "Init_Exchange_All",
"peer_triggered": 0,
"profile_status": "Merge_Failed",
"local_status": "Verify_Failure",
"local_error": "Peer 10.77.143.233 unable to accept lock request",
"peer_address": "10.77.143.233",
"peer_sync_status": "Not_yet_merged",
"merge_flags": "Merge Flags: pending_merge:1 rcv_merge:0 pend_validate:0",
"remote_status": "Verify_Failure",
"remote_error": "Global-db modification in progress"
},
{
"session_index": 3,
"start_usec": 792537,
"start_time": "Fri Jul 27 09:20:37 2018",
"end_usec": 13960,
"end_time": "Fri Jul 27 09:20:38 2018",
"revision_number": 1,
"session_type": "Initial_Exchange",
"session_subtype": "Init_Exchange_All",
"peer_triggered": 0,
"profile_status": "Merge_Failed",
"local_status": "Verify_Failure",
"local_error": "Peer 10.77.143.233 unable to accept lock request",
"peer_address": "10.77.143.233",
"peer_sync_status": "Not_yet_merged",
"merge_flags": "Merge Flags: pending_merge:1 rcv_merge:0 pend_validate:0",
"remote_status": "Verify_Failure",
"remote_error": "Global-db modification in progress"
},
{
"session_index": 4,
"start_usec": 320140,
"start_time": "Fri Jul 27 09:20:58 2018",
"end_usec": 369289,
"end_time": "Fri Jul 27 09:21:00 2018",
"revision_number": 1,
"session_type": "Initial_Exchange",
"session_subtype": "Init_Exchange_All",
"peer_triggered": 1,
"profile_status": "Sync_Success",
"local_status": "Commit_Success",
"local_error": "",
"peer_address": "10.77.143.233",
"peer_sync_status": "Not_yet_merged",
"merge_flags": "Merge Flags: pending_merge:1 rcv_merge:1 pend_validate:0",
"remote_status": "Commit_Success",
"remote_error": ""
},
{
"session_index": 5,
"start_usec": 373899,
"start_time": "Fri Jul 27 09:21:05 2018",
"end_usec": 743620,
"end_time": "Fri Jul 27 09:21:07 2018",
"revision_number": 1,
"session_type": "Initial_Exchange",
"session_subtype": "Init_Exchange_All",
"peer_triggered": 0,
"profile_status": "Sync_Success",
"local_status": "Commit_Success",
"local_error": "",
"peer_address": "10.77.143.233",
"peer_sync_status": "In_sync",
"remote_status": "Commit_Success",
"remote_error": ""
}
]
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show switch-profile test session-history command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show switch-profile test status commit
show switch-profile test status commit
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 switch-profile test status commit",
"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 switch-profile test status commit",
"msg": "Success",
"code": "200",
"body": {
"prof-name": "test",
"TABLE_session": {
"ROW_session": {
"session_index": 0,
"start_usec": 335528,
"start_time": "Fri Jul 27 09:57:11 2018",
"end_usec": 401449,
"end_time": "Fri Jul 27 09:57:14 2018",
"revision_number": 2,
"session_type": "Commit",
"session_subtype": "-",
"peer_triggered": 0,
"profile_status": "Sync_Success",
"local_status": "Commit_Success",
"local_error": "",
"peer_address": "10.77.143.233",
"peer_sync_status": "In_sync",
"remote_status": "Commit_Success",
"remote_error": ""
}
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show switch-profile test status commit command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|