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

question: can we parse and print edit-config or edit-data before pushing into the sysrepo database. #3281

Open
samba2127 opened this issue Apr 29, 2024 · 16 comments
Labels
is:question Issue is actually a question.

Comments

@samba2127
Copy link

Hi,

is it possible to write my validations check function ? if yes please let me know where can i write my own validate function for each module to validate without using the default or range values.

Thanks
Samba

@michalvasko
Copy link
Collaborator

validate without using the default or range values

It is not possible to avoid the standard YANG validation, you can only add your own.

is it possible to write my validations check function ?

The direct approach is to write standard sysrepo module change callbacks when you have the option to validate and refuse the configuration changes on the SR_EV_CHANGE event.

@michalvasko michalvasko added the is:question Issue is actually a question. label Apr 29, 2024
@samba2127
Copy link
Author

samba2127 commented Apr 29, 2024 via email

@michalvasko
Copy link
Collaborator

Yes, the configuration is fully refused (not reverted because it is not applied yet), see the docs. There are no specific examples of this because there is nothing to it. Just call sr_module_change_subscribe() with your callback (an example of that can be found here) and return an error code (not SR_ERR_OK) from the callback in case your validation fails. The rest is handled by sysrepo.

@samba2127
Copy link
Author

samba2127 commented May 9, 2024 via email

@michalvasko
Copy link
Collaborator

I am not here to explain NETCONF or YANG, please read the specs.

@samba2127
Copy link
Author

samba2127 commented May 13, 2024 via email

@michalvasko
Copy link
Collaborator

If you are asking about connecting and authenticating to netopeer2-server they yes, you need to configure the authentication mechanisms in its YANG configuration stored in sysrepo. You can manually edit the configuration using sysrepocfg -E vim -m ietf-netconf-server, for example. You can find example segments of the supported configuration in netopeer2/example_configuration/ssh_listen.xml.

@samba2127
Copy link
Author

samba2127 commented May 13, 2024 via email

@michalvasko
Copy link
Collaborator

In the current SSH server YANG module a specific single authentication method must be configured for each user. Meaning you need to select only one method for a user but each user can have a different authentication method.

@samba2127
Copy link
Author

samba2127 commented May 23, 2024 via email

@samba2127
Copy link
Author

samba2127 commented May 23, 2024 via email

@michalvasko
Copy link
Collaborator

You need to send a valid XML. The prefix is needed but it must also be defined. I am sorry but you really must know how XML works, look at a tutorial.

@samba2127
Copy link
Author

samba2127 commented May 30, 2024 via email

@michalvasko
Copy link
Collaborator

michalvasko commented May 30, 2024

Yes, that is expected and works as specified. Please learn all these basics before asking anything.

@samba2127
Copy link
Author

samba2127 commented Jun 19, 2024 via email

@michalvasko
Copy link
Collaborator

Me neither, this is exactly the executed sequence of scripts during the installation. And it works fine there so I am not able to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:question Issue is actually a question.
Projects
None yet
Development

No branches or pull requests

2 participants