Forum Discussion
mugude_243668
Nimbostratus
Aug 24, 2016IControl Rest - comman show ip route
Hello,
Is it possible to do a rest api call to obtain the same result of cli command:
show ip route vrf "vrfName"
Thanks a lot
J. Valentin
R_Marc
Nimbostratus
Aug 25, 2016I don't believe iControl exposes IMISH directly, but you could do something like this:
curl -sk -u admin:$PASS -H "Content-Type: application/json" -X POST https://bip1/mgmt/tm/util/bash -d "{\"command\":\"run\",\"utilCmdArgs\":\"-c 'tmsh imish -e \\\"show ip route\\\"'\"}" | python -m json.tool
{
"command": "run",
"commandResult": "Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP\n O - OSPF, IA - OSPF inter area\n N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2\n E1 - OSPF external type 1, E2 - OSPF external type 2\n i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area\n * - candidate default\n\nGateway of last resort is 10.0.244.10 to network 0.0.0.0\n\nK* 0.0.0.0/0 [0/0] via 10.0.244.10, DMZI_VLAN\nC 10.0.244.0/22 is directly connected, DMZI_VLAN\nC 127.0.0.1/32 is directly connected, lo\nC 127.1.1.254/32 is directly connected, tmm\nC 192.168.0.0/24 is directly connected, HA_VLAN\nC 1.64.2.0/24 is directly connected, INTERNET_VLAN\n",
"kind": "tm:util:bash:runstate",
"utilCmdArgs": "-c 'tmsh imish -e \"show ip route\"'"
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects