how to get XML RPC from cisco router (ex.show version)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 02:47 AM
Hi ,
I am in automation team using XML /PRC with YDK for config / verify commands in cisco NCS routers.
For ex . If i want to get XML RPC for " show version" command . How can i get it from router .
Please let us know your valuable inputs
Thanks
Jay
- Labels:
-
YANG Development Kit (YDK)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 10:00 AM
What is the application language that you are willing to use? Currently YDK supports C++ version 11, Python 2.7, 3.4, 3.6, and Go 9.1.
The RPC input depends on the router's YANG model. The last is tied to software release. Could you please tell me what is the output of 'show version' CLI command on your router.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2018 05:22 AM
Thank you for your mail . In Junos there is option to get XML RPC for cli to xml command . "show bgp session | display xml rpc"
will provide xml rpc out put .
Similarly can we get the same xml RPC output from cisco network elements.
Thanks
Jay

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2018 01:42 PM - edited 10-22-2018 01:57 PM
Currently there is not such tool in IOS-XR for show command. Please provide a list of show commands you are interested in and we could point you to the models:
For example,
https://community.cisco.com/t5/yang-development-kit-ydk/need-help-to-translate-some-commands-to-yang-model-in-ios-xr/td-p/3562413
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2020 05:51 AM
Hi,
Appreciate if I can get help on RPC request for "show inventory raw" and "show version" command for cisco XR.
Thanks..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2020 09:17 AM - edited 08-24-2020 09:38 AM
As of XR-6.5.3, there are no differences in CLI->XML support. Still the only command that can be translated to XML is 'show run'. Example:
RP/0/RP0/CPU0:iosxr1#sh run netconf | xml
Mon Aug 24 22:37:20.488 UTC
<data>
<netconf xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-man-xml-ttyagent-cfg">
<agent>
<tty>
<enable></enable>
</tty>
</agent>
</netconf>
</data>
RP/0/RP0/CPU0:iosxr1#
Unfortunately this feature application is even more restricted. It is implemented for very limited number of top level containers, like one above or 'interfaces'.
YDK Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2018 01:49 PM
Examples:
RP/0/RP0/CPU0:gnmi#show run router bgp | xml
Mon Oct 22 10:38:36.177 UTC
% No such configuration item(s)
RP/0/RP0/CPU0:gnmi#sh run int | xml
Mon Oct 22 10:39:18.392 UTC
172.16.255.1
...
The 'show version' command is classified as operational data. Unfortunately at this time we do not support translation for operational data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2020 11:04 PM
Hi Jay,
May I now the reason why you need XML RPC from router ?
Global Telecom
