Implementation using SYS-REPO for Cicso like cli

24 views
Skip to first unread message

Vivek Singh

unread,
Oct 15, 2024, 1:18:22 AM10/15/24
to klish
Hi,

We are currently looking for an alternative for confd-cli which we were currenly using in our project. We have more than 300 yang modules. we are looking for a alternative and hence did go through KLISH. Since we have huge list of yang modules and wanted to use the same, we found klish-3.1.0--sysrepo which basically make use of SYSREPO which can read the yang schema files. While playing around with the same, i have few doubts:

1) Can we be able to apply the configurations immediately Like CISCO instead of JUNIPER like where commit is required ?
2) On understanding the sysrepo.xml, in configuration mode also we need to mention commands like do,set etc, Actually configuration mode should be suffcient and should not require further commands like do/set/show etc ? is it possible to get away with those?

Regards,
Vivek Kumar Singh

Serj Kalichev

unread,
Oct 15, 2024, 2:34:19 AM10/15/24
to kl...@googlegroups.com
Hi

1) Basically sysrepo klish plugin uses Juniper-like scheme with "commit".

You can use miltiple ACTIONs for "set" command:

<ACTION sym="set_func"/>
<ACTION sym="commit_func"/>

It means that single command will execute two functions. The second function will be executed if the retcode of the first one is "success". So it will emulate immediate CISCO-commands.

Also you can patch the klish's sysrepo plugin to make special function that "set" and immediate "commit" the changes. It's not difficult because code already contains functions for the "set" and "commit".

But probably it will be slowly. The "commit" is not klish feature but sysrepo's feature. It firstly validates configuration and then commits. It's not fast. So another engine (not klish) with sysrepo and YANG will be slow too.

It's your own decision but I recommend Juniper-like scheme for YANG configuration - with commit. The Juniper-like scheme allows to make configuration more consistent.

2) Yes it's possible to start klish with "configuration" mode VIEW without "command"/"enable" mode VIEW and "do", "show" commands. But I don't understand your question about "set" command. Configuration mode needs "set" command because there is "del" command to remove configuration fields. How to differentiate these functions without "set"/"del" commands?


15.10.2024 08:18, Vivek Singh пишет:

--
You received this message because you are subscribed to the Google Groups "klish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to klish+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/klish/98dbfbde-27bd-4870-9d6d-3d8eccfe7978n%40googlegroups.com.


Reply all
Reply to author
Forward
0 new messages