clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
216 stars 71 forks source link

Netconf delete/remove operation doesn‘t work? #531

Closed magicalfox007 closed 3 months ago

magicalfox007 commented 3 months ago

I use clixon-4.2.0 It seems that netconf delete/remove operation doesn't work.

rpc example: <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><edit-config><target><candidate/></target><default-operation>none</default-operation><config><interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"><interface operation="delete"><name>agg1</name></interface></interfaces></config></edit-config></rpc>]]>]]>

reply is ok: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><ok/></rpc-reply>]]>]]>

but content in database didn't change: (the target interface still exist) `

agg1 agg1 false ......`
magicalfox007 commented 3 months ago

This problem appears to be due to a misspecification of xml tag. The corrected rpc xml: <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><edit-config><target><candidate/></target><config><interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"><interface xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="delete"><name>agg1</name></interface></interfaces></config></edit-config></rpc>]]>]]>

nc tag is required.

olofhagsand commented 3 months ago

Possibly one should return a proper error message, but it is problematic with unknown attributes (operation in namespace urn:ietf:params:xml:ns:yang:ietf-interfaces . Clixon currently just ignores them.

magicalfox007 commented 3 months ago

Thx for reply, operation tag seems to be ignored if nc is not specifified,the request will be treated as a merge operation.