cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
850
Views
5
Helpful
4
Replies
Highlighted

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

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

4 REPLIES 4
Highlighted
Cisco Employee

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

Let me clarify. The YDK gives the programmer tools to enable management application to talk to the router based on YANG data model. The YDK includes multiple services to do that. Most popular are Netconf, Restconf, gNMI, CRUD as well as Path API. Each of the services allow you to build RPC or gRPC, send it to device, receive response and process it. What services (protocol) do you have in mind for your application?



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.


Highlighted

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

Hi ygorelik ,

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
Highlighted
Cisco Employee

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

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

Highlighted
Cisco Employee

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

Currently the Cisco devices support CLI -> XML conversion only for device configuration (show run ...). It is implemented directly in CLI and very easy to use.



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







act

Loopback10



Test interface







172.16.255.1


255.255.255.255









...



The 'show version' command is classified as operational data. Unfortunately at this time we do not support translation for operational data.