Vyatta Network OS Documentation

Learn how to install, configure and operate the Vyatta NOS, which helps drive our virtual networking & physical platforms portfolio.

Lock a session — <lock>

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 <lock>:

Use the <lock> RPC.
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <lock>
    <target>
      <candidate/>
    </target>
  </lock>
</rpc>
]]>]]>
Note: Unlock

To unlock the session, you would simply replace lock with unlock in this code example.

The unlock operation happens automatically when you use <close-session>.