klish-plugin-sysrepo

16 views
Skip to first unread message

Vivek Singh

unread,
Dec 18, 2024, 1:42:26 PM12/18/24
to klish
Hi Team,

I am using klish 3 with klish-plugin-sysrepo to connect to the sysrepo.
I have installed my modules in the sysrepo. 
All the configuration are augumented with /exa:config/ and all the operational data/status with /exa:status/

With klish-plugin-sysrepo: currently the configuration nodes are being fetched which was augumented with config but not the status one.

Does klish-sysrepo-plugin does not support operational data fetch.
How do we modify the current klish-sysrepo plugin to do the same.


Main view:
configuration:
Show: 

configuration should be used to configure. get-config/edit-config to be supported.

show : should be used to display the operational data and not only the configured data..  get-status to be supported.

Please help in getting the operational data 

Regards,
Vivek Kumar Singh


Vivek Singh

unread,
Dec 18, 2024, 1:51:52 PM12/18/24
to klish
Basically the Schema related to operational data is not being fetched and cuto completion for the same is not working..
After giving tab for show, it should display all the valid nodes which basically should be read from schema with exa:status:

Serj Kalichev

unread,
Dec 19, 2024, 11:31:38 AM12/19/24
to kl...@googlegroups.com
Hi

Now plugin ignores non-config fields while path parsing.
Note you can't show config and status info in the same time and by the same command because "operational" and "running" are different datastores. So engine must know which datastore to use.

18.12.2024 21:51, 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 visit https://groups.google.com/d/msgid/klish/ceb24a15-f7b8-4fe3-abef-800365c9f1d9n%40googlegroups.com.


Vivek Singh

unread,
Dec 22, 2024, 7:02:58 AM12/22/24
to kl...@googlegroups.com
HI Serj,
Thanks for your response.

I want the plugin not to ignore the non-config fields during path parsing. Can you highlight the changes required to do so.

Yes, i am aware that i cannot do show config(configurational) and show status (operational) using the same command.

I am planning to change the sysrepo.xml to have the main view as :

config : This will have all the options related to configurational data. and should have the xpaths related for the same.
             show inside the configuration will show the configuration data

show : This will be used for all the options related to operational data. For my schema file, all the nodes which are augmented under /status/ should be shown 

Really looking for your help in this regards... 

<PTYPE name="PLINE_SHOW_OPERATIONAL">
        <COMPL>
                <ACTION sym="srp_show_operational@sysrepo"/>
        </COMPL>
        <HELP>
                <ACTION sym="srp_help_operational@sysrepo"/>
        </HELP>
        <ACTION sym="PLINE_SHOW_OPERATIONAL@sysrepo"/>
</PTYPE>

Probably i need to implement something like this with new fuctions to get the auto-completions and help strings. and a new action function to get the operational data.

Can you please help me in writting a new functions to fetch the same.

Regards,
Vivek Kumar Singh

Vivek Singh

unread,
Dec 27, 2024, 5:01:33 PM12/27/24
to kl...@googlegroups.com
Hi Serj,

I really need your help on this.
Do i need to have a new sysrepo connection for retrieving operational data set? or can i use the existing connection itself to fetch the operational nodes and its data.??

Can you please answer the above mentioned questions?

Regards,
Vivek kUmar Singh

Serj Kalichev

unread,
Dec 28, 2024, 8:59:39 AM12/28/24
to kl...@googlegroups.com
Hi

The klish-plugin-sysrepo/src/show.c contains show_node() with the following code:

if (!(schema->flags & LYS_CONFIG_W))
    return;

It ignores non-config entries. Note this is not the only place with ignoring. Some other functions contain the same code.
May be "pline_opts_t" structure (or some another struct) need additional field to indicate to show operational fields or not. Because if you just remove the conditions then config-related parsing will show operational - it's not good.


22.12.2024 15:02, Vivek Singh пишет:

Serj Kalichev

unread,
Dec 28, 2024, 9:04:14 AM12/28/24
to kl...@googlegroups.com
Hi

You don't need another connection. Even you don't need another session. See the sr_session_switch_ds() to switch to operational data store for the current session.

26.12.2024 15:40, Vivek Singh пишет:
Reply all
Reply to author
Forward
0 new messages