Chapter 3
NETCONF Sessions
RUGGEDCOM NETCONF
Reference Guide
26 Closing the Session
<capabilities>
<capability>urn:ietf:params:netconf:base:1.0</capability>
</capabilities>
</hello>]]>]]>
The device does not reply to the <hello> response unless there is an error. After issuing the <hello> response,
you can begin sending NETCONF requests.
Section3.4
Closing the Session
Closing a session requests the graceful termination of a NETCONF session. It is recommended that you use
the <close-session> command to close each NETCONF session. Upon closing the session, the device also
terminates the SSH connection.
When the server receives a <close-session> request, it does the following:
• gracefully closes the session
• releases any locks and resources associated with the session
• gracefully closes any associated connections
• ignores any NETCONF requests received after the <close-session> request
If the NETCONF device can complete the request, it sends an <rpc-reply> document containing the <ok>
element.
If the NETCONF device cannot complete the request, it sends an <rpc-reply> document containing the <rpc-
error> element.
To close a NETCONF session, send the following:
<rpc message-id="2010" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<close-session/>
</rpc>]]>]]>
Upon successfully closing the session, the device responds with the following:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2010">
<ok/>
</rpc-reply>]]>]]>
Section3.5
Killing a Session
Killing a session terminates a specified NETCONF session, cancelling any operations in progress and releasing
all locks, resources, and connections for the session. Use the <kill-session> command to close NETCONF
sessions other than the current session. You cannot use <kill-session> to close the session from which the
command is used.
<kill-session> does not roll back the configuration or state changes made by the configuration being
terminated. If the session being terminated is performing a confirmed commit when the <kill-session> is
issued, the NETCONF server restores the configuration to its state before the confirmed commit was issued.