[NETCONF-1214] problems with GET/POST/DELETE of list elements with key of type instance-identifier Created: 18/Dec/23 Updated: 18/Dec/23 |
|
| Status: | Open |
| Project: | netconf |
| Component/s: | restconf-nb |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Medium |
| Reporter: | Maurizio Brigandi' | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
version: karaf 18.3 and 19.1 |
||
| Attachments: |
|
| Description |
|
version: karaf 18.3 and 19.1 I have the following GET working fine. Please note that "interface" is a list with key "name". curl -X GET -u admin:admin -H "content-type: application/yang-data+json" http://172.17.0.72:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device-serverssh_telstar_6126_brigam_1/yang-ext:mount/smo-routing:routing/control-plane-protocol=MANAGEMENT-PLANE/smo-is-is:isis?fields=interface ]}} --> OK ------------------------------------------ I'm not able to GET directly the "interface" list element whose key is name curl -X GET -u admin:admin -H "content-type: application/yang-data+json" http://172.17.0.72:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device-serverssh_telstar_6126_brigam_1/yang-ext:mount/smo-routing:routing/control-plane-protocol=MANAGEMENT-PLANE/smo-is-is:isis/interface=%2Fsmo-interfaces%3Ainterfaces%2Fif%5BtypeIf%3D%27lan%27%5D%5Bidx%3D%271%27%5D ] --> KO The only way ODL accepts is to use the netconf-like instance-identifier format for the "name" key, repeating all prefixes even when they do not change. However this is not the format indicated in https://datatracker.ietf.org/doc/html/rfc7951#section-6.11 curl -X GET -u admin:admin -H "content-type: application/yang-data+json" http://172.17.0.72:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device-serverssh_telstar_6126_brigam_1/yang-ext:mount/smo-routing:routing/control-plane-protocol=MANAGEMENT-PLANE/smo-is-is:isis/interface=%2Fsmo-interfaces%3Ainterfaces%2Fsmo-interfaces%3Aif%5Bsmo-interfaces%3AtypeIf%3D%27lan%27%5D%5Bsmo-interfaces%3Aidx%3D%271%27%5D --> Accepted by ODL -------------- I'm not able to DELETE directly the "interface" list element whose key is name
curl -X DELETE -u admin:admin -H "content-type: application/yang-data+json" http://172.17.0.72:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device-serverssh_telstar_6126_brigam_1/yang-ext:mount/smo-routing:routing/control-plane-protocol=MANAGEMENT-PLANE/smo-is-is:isis/interface=%2Fsmo-interfaces%3Ainterfaces%2Fif%5BtypeIf%3D%27lan%27%5D%5Bidx%3D%271%27%5D ] --> KO The only way ODL accepts it is to use the netconf-like instance-identifier format for the "name" key, repeating all prefixes even when they do not change. However this is not the format indicated in https://datatracker.ietf.org/doc/html/rfc7951#section-6.11 curl -X DELETE -u admin:admin -H "content-type: application/yang-data+json" http://172.17.0.72:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device-serverssh_telstar_6126_brigam_1/yang-ext:mount/smo-routing:routing/control-plane-protocol=MANAGEMENT-PLANE/smo-is-is:isis/interface=%2Fsmo-interfaces%3Ainterfaces%2Fsmo-interfaces%3Aif%5Bsmo-interfaces%3AtypeIf%3D%27lan%27%5D%5Bsmo-interfaces%3Aidx%3D%271%27%5D --> Accepted by ODL -------------- Creation of the "interface" list element is failing with error 500 in html format (it should be restconf json format), however it is created successfully in the ssh server curl -X POST -u admin:admin -H "content-type: application/yang-data+json" http://172.17.0.72:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device-serverssh_telstar_6126_brigam_1/yang-ext:mount/smo-routing:routing/control-plane-protocol=MANAGEMENT-PLANE/smo-is-is:isis --data '{"smo-is-is:interface": [ {"name": "/smo-interfaces:interfaces/if[typeIf='\''lan'\''][idx='\''1'\'']", "priority1": 16}]}' <html> </body> --> KO The same error in case the netconf-like instance-identifier format is used, repeating all prefixes even when they do not change: curl -X POST -u admin:admin -H "content-type: application/yang-data+json" http://172.17.0.72:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device-serverssh_telstar_6126_brigam_1/yang-ext:mount/smo-routing:routing/control-plane-protocol=MANAGEMENT-PLANE/smo-is-is:isis --data '{"smo-is-is:interface": [ {"name": "/smo-interfaces:interfaces/smo-interfaces:if[smo-interfaces:typeIf='\''lan'\''][smo-interfaces:idx='\''1'\'']", "priority1": 16}]}' </body>
ODL internal LOG during POST is attached as a file to this ticket, an internal error is traced.
From our SSH log we see that the command was successfully received and executed by SSH server and ok was sent to ODL as reply: <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-172"><ok/></rpc-reply> <?xml version="1.0" encoding="UTF-8" standalone="no"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-173"><ok/></rpc-reply> <?xml version="1.0" encoding="UTF-8" standalone="no"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-174"><ok/></rpc-reply> <?xml version="1.0" encoding="UTF-8" standalone="no"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-175"><ok/></rpc-reply> <?xml version="1.0" encoding="UTF-8" standalone="no"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-176"><ok/></rpc-reply>
Doing a GET we see that it is really present after the POST: ]}} --> OK, it was created even if an error was returned to the POST
|