[NETCONF-221] ControllerContext#addKeyValue ignores key type when key is derived type from instance-identifier Created: 22/Jun/16  Updated: 15/Mar/19  Resolved: 04/Oct/16

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Ivan Hrasko Assignee: Jakub Toth
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 6099

 Description   

The ovsdb.yang model includes:

typedef ovsdb-bridge-ref

{ description "A reference to an ovsdb bridge"; type instance-identifier; }


list managed-node-entry {
key "bridge-ref";
leaf bridge-ref

{ type ovsdb-bridge-ref; }

}

Using the md-sal apidocs explorer, I enter the following for doing a GET on managed-node-entry with a bridge-ref key value:

topology-id: ovsdb:1
node-id: ovsdb:HOST1
bridge-ref: /network-topology:network-topology/network-topology:topology[network-topology:topology-id='ovsdb:1']/network-topology:node[network-topology:node-id='ovsdb:HOST1/bridge/br-test']

This is what the resulting request URL looks like:
http://localhost:8181/restconf/config/network-topology:network-topology/topology/ovsdb%3A1/node/ovsdb%3AHOST1/ovsdb:managed-node-entry/%2Fnetwork-topology%3Anetwork-topology%2Fnetwork-topology%3Atopology%5Bnetwork-topology%3Atopology-id%3D'ovsdb%3A1'%5D%2Fnetwork-topology%3Anode%5Bnetwork-topology%3Anode-id%3D'ovsdb%3AHOST1%2Fbridge%2Fbr-test'%5D/

The response code to the request is 400 and the response body is
{
"errors": {
"error": [

{ "error-type": "protocol", "error-tag": "invalid-value", "error-message": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id='ovsdb:1']/network-topology:node[network-topology:node-id='ovsdb:HOST1/bridge/br-test'] from URI can't be resolved. " }

]
}
}

The ODL log prints out this INFO message:
2016-06-14 02:29:14,973 | INFO | qtp810954400-800 | RestCodec$ObjectCodec | 238 - org.opendaylight.netconf.sal-rest-connector - 1.4.0.SNAPSHOT | Value is not instance of InstanceIdentifierTypeDefinition but is class java.lang.String. Therefore NULL is used as translation of - /network-topology:network-topology/network-topology:topology[network-topology:topology-id='ovsdb:1']/network-topology:node[network-topology:node-id='ovsdb:HOST1/bridge/br-test']



 Comments   
Comment by Isaku Yamahata [ 09/Jul/16 ]

https://git.opendaylight.org/gerrit/#/c/41545/
Does the above patch help?

Comment by Ivan Hrasko [ 11/Jul/16 ]

Thanks I will try it soon..

Comment by Ivan Hrasko [ 12/Jul/16 ]

I think that patch above is not a solution for the problem.
There is always forwarded String from org.opendaylight.netconf.sal.restconf.impl.ControlerContext#addKeyValue to org.opendaylight.netconf.sal.restconf.impl.RestCodec#deserialize

Comment by Jakub Toth [ 12/Sep/16 ]

Can you test this patch, please ?
https://git.opendaylight.org/gerrit/#/c/45486/

Generated at Wed Feb 07 20:14:28 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.