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

@PravalliSure

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions