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

Query on right API to use to get sessions information #291

Open
PravalliSure opened this issue Aug 30, 2024 · 1 comment
Open

Query on right API to use to get sessions information #291

PravalliSure opened this issue Aug 30, 2024 · 1 comment

Comments

@PravalliSure
Copy link

I have a situation where I need to send a kill-session from a sysrepo application on a different session that locked Datastore. I did this and I am able to kill the session

  rpc = nc_rpc_kill(1);
  msgtype = nc_send_rpc(session, rpc, 0, &msgid);

Now I want to extract the session id from ietf-netconf-monitoring which locked running datastore and send it as parameter.
Which is the best netconf API that I can use?

  const char* get_locks_rpc = "/ietf-netconf-monitoring:netconf-state/datastores/datastore[name='running']";
  nc_rpc* rpc = nc_rpc_get(get_locks_rpc, NC_WD_UNKNOWN, NC_PARAMTYPE_CONST);
  msgtype = nc_send_rpc(session, rpc, 0, &msgid);

This doesn't work

@michalvasko
Copy link
Member

michalvasko commented Sep 2, 2024

Yes, getting the session ID from ietf-netconf-monitoring data is the only way. What exactly is the problem with this?

Also, are you really using libnetconf or is it libnetconf2?

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

No branches or pull requests

2 participants