While I tried to save through confd cli and confd netconf, the xml file was saved correctly as below.
So could you let me know how to use confd_load to have the sharedNetwork that has name as “test” saved in XML file, as what I saved via CLI.
bash-4.2# /usr/confd/bin/confd_cli -C
test# config
test(config)# save /usr/confd/test_cli.xml xml dhcp SharedNetworks sharedNetwork test
Saving parts of the configuration.
test(config)# end
<-rpc message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" >
<-get-config>
<-source>
<-running/>
<-/source>
<-!-- get the user named fred -->
<-filter xmlns:dhcpd="http://tail-f.com/ns/example/dhcpd"
type="xpath"
select="/dhcpd:dhcp/dhcpd:SharedNetworks/dhcpd:sharedNetwork[dhcpd:name='test']"/>
<-/get-config>
<-/rpc>]]>]]>
<-rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<-data>
<-dhcp xmlns="http://tail-f.com/ns/example/dhcpd">
<-SharedNetworks>
<-sharedNetwork>
<-name>test</name>
<-/sharedNetwork>
<-/SharedNetworks>
<-/dhcp>
<-/data>
<-/rpc-reply>
CLI test
test# config
test(config)# save /usr/confd/test_cli.xml xml dhcp SharedNetworks sharedNetwork test
Saving parts of the configuration.
test(config)# end