Lock a session —
An example of how to use the
<lock> RPC to lock a session.
Vyatta NOS supports a single NETCONF session. Multiple users may connect to this session simultaneously, so it is important to terminate sessions cleanly by use of
<close-session>. This will clear any locks that are on the session.
However, if you wish to lock the candidate configuration so that no
non-NETCONF users can modify it during your session, use
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <lock> <target> <candidate/> </target> </lock> </rpc> ]]>]]>
To unlock the session, you would simply replace
unlock in this code example.
The unlock operation happens automatically when you use