[DOCS-150] 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: | docs |
| Component/s: | General |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | High |
| Reporter: | Maurizio Brigandi' | Assignee: | Luis Gomez |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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 to do it is to use the netconf-like instance-identifier format for the "name" key. 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 --> OK -------------- 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%2Fsmo-interfaces%3Aif%5BtypeIf%3D%27lan%27%5D%5Bsmo-interfaces%3Aidx%3D%271%27%5D ] --> KO The only way to do it is to use the netconf-like instance-identifier format for the "name" key. 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 --> OK -------------- 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: 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 LOG during POST is attached as a file
From our SSH log we see that the command is successfully executed: Session 18 [DBG]: 2023-12-18T11:02:38Z: Received message:
<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 present: ]}} --> OK, it was created even if an error was returned to the POST
|
| Comments |
| Comment by Maurizio Brigandi' [ 18/Dec/23 ] |
|
wrong DOC-150 ticket category used, please remove this ticket and see the right one here: https://jira.opendaylight.org/browse/YANGTOOLS-1558 |