Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: support xpath functions for strings #556

Open
trentzhou opened this issue Sep 18, 2024 · 6 comments
Open

feature request: support xpath functions for strings #556

trentzhou opened this issue Sep 18, 2024 · 6 comments

Comments

@trentzhou
Copy link

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

  • string-length
  • substring
  • translate
  • starts-with
  • substring-before
  • substring

Is it possible to add such support?

@olofhagsand
Copy link
Member

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
Copy link
Author

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
Copy link
Member

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
Copy link
Member

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
Copy link

getabc commented Oct 31, 2024

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

olofhagsand added a commit that referenced this issue Nov 2, 2024
Added: re-match, substring, string, string-length, translate, substring-before, substring-after, starts-with
@olofhagsand
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants