show line
show line
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 line",
"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 line",
"msg": "Success",
"code": "200",
"body": {
"speed": 115200,
"databits": 8,
"stopbits": 1,
"parity": "none",
"modem_in": " Modem In: Disable",
"modem_init_str": " default : ATE0Q1&D2&C1S0=1\\015",
"stat": "Statistics: tx:76675 rx:1551 Register Bits:hw_wknd:3\n",
"speed_aux": 9600,
"databits_aux": 8,
"stopbits_aux": 1,
"parity_aux": "none",
"modem_in_aux": " Modem In: Disable",
"modem_init_str_aux": " default : ATE0Q1&D2&C1S0=1\\015",
"hw_fc_aux": " Hardware Flowcontrol: ON",
"stat_aux": "Statistics: tx:0 rx:0|00|01|03|00|60|00|00| Register Bits:\n",
"TABLE_ps_output": {
"ROW_ps_output": {
"ps": "root 21209 1 0 19:55 ttyS0 00:00:00 login -- admin\n"
}
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show line command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|