bgpd: add json option to show commands in bgp_nexthop
Commands with json option:
- show bgp nexthop
- show bgp import-check-table
Example output below, "nexthop" and "import-check-table" are only
different in the nexthop entries, the format is the same
```
leaf-A# show bgp nexthop 10.11.10.1 detail json
{
"nexthops":{
"10.11.10.1":{
"valid":true,
"complete":true,
"igpMetric":0,
"pathCount":1,
"peer":"10.11.10.1",
"gates":[
{
"ifname":"eth1"
}
],
"lastUpdate":{
"epoch":
1669161758,
"string":"Wed Nov 23 00:02:38 2022\n"
},
"paths":[
{
"afi":"IPv4",
"safi":"unicast",
"prefix":"192.168.11.0/24",
"vrf":"default",
"flags":[
"valid",
"dmedSelected",
"counted"
]
}
]
}
}
}
leaf-A# show bgp nexthop json
{
"nexthops":{
"10.10.10.1":{
"valid":true,
"complete":true,
"igpMetric":0,
"pathCount":1,
"peer":"10.10.10.1",
"gates":[
{
"ifname":"eth0"
}
],
"lastUpdate":{
"epoch":
1669161758,
"string":"Wed Nov 23 00:02:38 2022\n"
}
},
"10.11.10.1":{
"valid":true,
"complete":true,
"igpMetric":0,
"pathCount":1,
"peer":"10.11.10.1",
"gates":[
{
"ifname":"eth1"
}
],
"lastUpdate":{
"epoch":
1669161758,
"string":"Wed Nov 23 00:02:38 2022\n"
}
}
}
}
```
Signed-off-by: Yaroslav Fedoriachenko <yar.fed99@gmail.com>