cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2302
Views
5
Helpful
7
Replies

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

7 Replies 7

ygorelik
Cisco Employee
Cisco Employee
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.


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

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

Hi,

Appreciate if I can get help on RPC request for "show inventory raw" and "show version" command for cisco XR.

Thanks..

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'.

Yan Gorelik
YDK Solutions

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.


Hi Jay,

 

May I now the reason why you need XML RPC from router ?

Jacky Zhang
Global Telecom
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers