How to remove element from configuration through netopeer

515 views
Skip to first unread message

lh.su...@gmail.com

unread,
May 14, 2015, 9:01:47 AM5/14/15
to neto...@googlegroups.com
Hi, all

I've noticed that there is an XMLDIFF_REM defined in libnetconf. But I'm not sure what kind of operation at netopeer-cli will cause the XMLDIFF_OP parameter of callback() function equal to XMLDIFF_REM. Is there anyone could help me to answer this question? Thanks first!

Best Regards,
Linhui

Michal Vasko

unread,
May 14, 2015, 9:12:58 AM5/14/15
to neto...@googlegroups.com, lh.su...@gmail.com
Hi Linhui,

any edit config whose XML data will include operation "remove" or "delete" and in the corresponding datastore there will be these nodes present. For more information look in the NETCONF RPC.

Regards,
Michal

Linhui Sun

unread,
May 14, 2015, 9:40:21 AM5/14/15
to Michal Vasko, neto...@googlegroups.com
HI, Michal

Thanks for you answer! When I refers to the RFC6241, I found a definition of "remove" but I'm still lost in how to use it. It seems that I should use <default-operation> tag in the XML, but I don't know where to type this tag. I tried put it at the beginning but there's no reaction. 

BR,
Linhui

Michal Vasko

unread,
May 15, 2015, 2:53:04 AM5/15/15
to neto...@googlegroups.com, lh.su...@gmail.com
Hi Linhui,

it is all written there, I wrote a specific example into libnetconf mailing list into topic "Problem using deleteconfig operation", so you can look there.

Regards,
Michal

Linhui Sun

unread,
May 15, 2015, 4:43:01 AM5/15/15
to Michal Vasko, neto...@googlegroups.com
Hi, Michal

I followed what you said in libnetconf ML, I've typed the XML as follows.

​But the netopeer-cli does not have any response as shown below,
I did not write any code in callback() for the case XMLDIFF_OP==XMLDIFF_REM, is the datastore.xml was wrongly typed or I have to write code for XMLDIFF_REM?

BR
Linhui

Michal Vasko

unread,
May 15, 2015, 6:43:10 AM5/15/15
to neto...@googlegroups.com, lh.su...@gmail.com
Hi Linhui,

I am a bit confused, but let's go step-by-step. You first issued an edit config with the configuration from the first screenshot. We can see the reply OK in the second screenshot, first edit-config meaning that there was such "dest-addr" in your running configuration and it got deleted. At this point I would suggest to send get-config and verify that this "dest-addr" was actually deleted, it should have been. But instead you tried to send another edit-config, which somehow failed (CLI got stuck the way it's in your screenshot? Did you type any data before? Are you using the CLI from the master branch?)?

Concerning your code, if you do not want to react in any way on removing this node, you do not need to do anything else. The configuration will get updated regardless of the code in your transAPI module.

Regards,
Michal
Reply all
Reply to author
Forward
0 new messages