clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
215 stars 72 forks source link

feature request: support xpath functions for strings #556

Open trentzhou opened 1 month ago

trentzhou commented 1 month ago

I tried to load some of our existing yang files with clixon. We have many must and when conditions which use xpath functions like:

Is it possible to add such support?

olofhagsand commented 1 month ago

It usually straightforward. There are so many of them, I do them on request. Most work with regression tests. May I ask which project/product this is?

trentzhou commented 1 month ago

I'm working on a commercial system. Currently we use confd as our netconf and cli server. Now that confd is going to end its service, we have to find an alternative. We are evaluating various open source and commercial solutions. I like the architecture of clixon. It's simple and easy to understand. But I found some feature gaps in my tests:

  1. The xpath support is not complete.
  2. Some yang modules fail to load. I have reported other issues.
  3. Confd supports external DB, but clixon does not. We hope there is a callback for get-config to get data from the external DB. Also we need the callback before edit-config.

I also found clixon_cli is using too much memory. With all our yang modules loaded, clixon_backend uses about 150MB memory, but clixon_cli uses 1.5GB.

We will not use use clixon in our product. I'm just reporting the issues I found in my tests.

olofhagsand commented 1 month ago

Thanks for the info and the issues. 1-2 are easy to fix, 3 I dont know, CLI memory: It is the autocli, generation of CLI rules from YANG that consumes memory. We are aware of the issue, and will try to address it.

olofhagsand commented 1 month ago

I also found clixon_cli is using too much memory. With all our yang modules loaded, clixon_backend uses about 150MB memory, but clixon_cli uses 1.5GB.

If you haven't, you should set <grouping-treeref>true</grouping-treeref> in autocli.xml to bring down cli memory.

getabc commented 4 days ago

We are currently working on a project and would greatly appreciate support for the substring and re-match XPath functions.

olofhagsand commented 2 days ago

Added the following XPath functions: re-match, substring, string, string-length, translate, substring-before, substring-after, starts-with Please verify