CESNET / netopeer2

NETCONF toolset
BSD 3-Clause "New" or "Revised" License
301 stars 189 forks source link

How to close the session with client from server #1366

Closed chendrashekarp closed 1 year ago

chendrashekarp commented 1 year ago

Hi @michalvasko, I need some help related to closing a client session from server based on few conditions, is there any API or way you can help me on this and this is with respect to multiple clients connection.

michalvasko commented 1 year ago

Generally, you should never close session on the server-side without receiving close-session from the client first. What API are you looking for exactly? netopeer2 is a NETCONF server, it has no API.

chendrashekarp commented 1 year ago

Okay @michalvasko , how to use kill-session RPC & how to know the sessions ?

michalvasko commented 1 year ago

how to use kill-session RPC

You could have included more details but equally short answer would be according to the specs. In netopeer2-cli you can use the kill-session --sid <sesion-ID> command.

how to know the sessions ?

Information about sessions is stored in the ietf-netconf-monitoring YANG module, so just retrieve its data and you will see all the sessions.