[NETCONF-2] Cannot perform any operations on leaves Created: 14/May/14 Updated: 15/Mar/19 Resolved: 10/Oct/17 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | restconf-nb |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | ||
| Reporter: | Rob Adams | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Linux |
||
| Issue Links: |
|
||||||||
| Description |
|
This should work according to the swagger API docs, but does not: $ curl http://localhost:8080/restconf/config/toaster:toaster/darknessFactor So should this (PUT and POST give the same error): H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - java.lang.String cannot be cast to org.opendaylight.controller.sal.restconf.impl.StructuredData</h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u>java.lang.String cannot be cast to org.opendaylight.controller.sal.restconf.impl.StructuredData</u></p><p><b>description</b> <u>The server encountered an internal error that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>java.lang.ClassCastException: java.lang.String cannot be cast to org.opendaylight.controller.sal.restconf.impl.StructuredData |
| Comments |
| Comment by Tom Pantelis [ 21/May/14 ] |
|
The cast exception is fixed with "Root element of Json has to be Object" which makes sense because it isn't valid json. Issuing this: curl -X POST -H 'Content-Type: application/json' -d ' {darknessFactor: "2000"}' http://localhost:8080/restconf/config/toaster:toaster/darknessFactor yields this error: "First element in Json Object has to be "Object" or "Array with one Object element". Other scenarios are not supported yet." So the controller's restconf doesn't (yet) support GET/PUT/POST to leaf nodes. The RESTCONF spec doesn't appear to preclude it. |
| Comment by Tom Pantelis [ 30/May/14 ] |
|
The RESTCONF spec states "Only YANG container and list data node types are considered to represent data resources. Other YANG data nodes are considered to be fields within their parent resource." The target type for a PUT (also for POST) is a data resource. Therefore, by the definition of data resource, PUT is not allowed for a leaf field of a data resource. It seems the PATCH method is intended to perform CUD on leaf fields, which is not currently implemented in ODL. |
| Comment by Rob Adams [ 30/May/14 ] |
|
At a minimum, we need to make these not appear in the API docs. |
| Comment by Jozef Gloncak [ 26/Sep/14 ] |
|
Currently only lists (with key values) or containers are presents in swagger URI links. If no other comments with additional requests will appear in few days regarding this bug I will close it. |
| Comment by Tony Tkacik [ 12/May/15 ] |
|
This would require upgrade of restconf to latest drafts. |
| Comment by Robert Varga [ 13/Nov/15 ] |
|
Move to NETCONF project |
| Comment by Robert Varga [ 10/Oct/17 ] |
|
Fixed in RFC8040 restconf |