Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

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

Open

Description

@PravalliSure

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

Activity

  1. michalvasko commented on Sep 2, 2024

    @michalvasko
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions