How do you use the --edit-config command option of netconf-console?

A typical way of using netconf-console is to supply a complete NETCONF XML payload as the only argument.

An example usage of netconf-console for modifying the configuration when working with the intro/1-2-3-start-query-model example is as follows:

 netconf-console cmd-set-dhcp-defaultLeaseTime-30m.xml

in which the contents of cmd-set-dhcp-defaultLeaseTime-30m.xml is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <capabilities>
    <capability>urn:ietf:params:netconf:base:1.0</capability>
  </capabilities>
</hello>
]]>]]>
<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <dhcp xmlns="http://tail-f.com/ns/example/dhcpd"
            xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
        <defaultLeaseTime nc:operation="merge">
          PT30M
        </defaultLeaseTime>
      </dhcp>
    </config>
  </edit-config>
</rpc>
]]>]]>
<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <close-session/>
</rpc>

However, netconf-console provides a simpler way to work with the NETCONF edit-config operation without you supplying the entire XML payload when you use the --edit-config command option as follows:

netconf-console --db=running --edit-config=edit-config-defaultLeaseTime.xml

in which the contents of edit-config-defaultLeaseTime.xml is as follows:

  <dhcp xmlns="http://tail-f.com/ns/example/dhcpd"
        xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
    <defaultLeaseTime nc:operation="merge">
      PT30M
    </defaultLeaseTime>
  </dhcp>

which is only the content inside of the < config > XML element for a single NETCONF edit-config operation.