Populate leaf node data cannot be erased by RESTCONF DELETE request. Request will fail on
{ "errors": { "error": [ { "error-tag": "operation-failed", "error-info": "java.lang.IllegalStateException: Value has not been set", "error-message": "Transaction failed", "error-type": "application" } ] } }
In attachment is provided karaf.log file.
Used YANG model:
module test-model { namespace "test:model"; prefix tm; revision 2021-11-11 { description "Initial revision."; } container test-container { leaf test-data { type string; } } }
Steps to reproduce:
- Add test-model.yang file to karaf schema `netconf/karaf/target/assembly/cache/schema`
- Start netconf-testtool with path to test-model.yang
java -Xmx1G -jar netconf-testtool-2.0.9-SNAPSHOT-executable.jar --schemas-dir SCHEMA_PATH --device-count 1 --debug false --starting-port 36001 --ssh true --md-sal false
- Start karaf and install features `odl-restconf-all` and `odl-netconf-topology`
- Connect netconf-testtol to Netconf:
curl --request PUT 'http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: Basic YWRtaW46YWRtaW4=' \ --data-raw '{ "node": [ { "node-id": "new-netconf-device", "netconf-node-topology:port": 36001, "netconf-node-topology:reconnect-on-changed-schema": false, "netconf-node-topology:connection-timeout-millis": 20000, "netconf-node-topology:tcp-only": false, "netconf-node-topology:max-connection-attempts": 0, "netconf-node-topology:username": "admin", "netconf-node-topology:password": "admin", "netconf-node-topology:sleep-factor": 1.5, "netconf-node-topology:host": "127.0.0.1", "netconf-node-topology:between-attempts-timeout-millis": 2000, "netconf-node-topology:keepalive-delay": 120 } ] }'
- Verify that device is connected.
- Populate test-data inside netconf-testtool
curl --request PUT 'http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device/yang-ext:mount/test-model:test-container' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: Basic YWRtaW46YWRtaW4=' \ --data-raw '{ "test-model:test-container": { "test-data": "data" } }'
- Verify that data was written
- Try to delete test-data
curl --request DELETE 'http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device/yang-ext:mount/test-model:test-container/test-data' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: Basic YWRtaW46YWRtaW4=' \ --data-raw ''
The issue was reported on lighty.io:
- relates to
-
NETCONF-563 NetconfMessageTransformUtil.toFilterStructure() fails for leaf instance identifiers
- Resolved
-
YANGTOOLS-1389 Deprecate overloaded ImmutableNodes.fromInstanceId()
- Resolved