-
Bug
-
Resolution: Done
-
Highest
-
Neon, Fluorine SR2, Sodium
-
None
Given RPC (no input):
rpc force-refresh {
output {
leaf result
}
}
when called via restconf like this:
curl -u admin:admin -X POST -v http://localhost:8181/restconf/operations/jsonrpc:force-refresh
Leads to following error:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Request failed.</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /restconf/operations/jsonrpc:force-refresh. Reason:
<pre> Request failed.</pre></p>
</body>
</html>
Karaf log indicates NPE:
Caused by: java.lang.NullPointerException
at org.opendaylight.netconf.sal.restconf.impl.RestconfImpl.invokeRpc(RestconfImpl.java:426) ~[?:?]
at org.opendaylight.netconf.sal.restconf.impl.StatisticsRestconfServiceWrapper.invokeRpc(StatisticsRestconfServiceWrapper.java:83) ~[?:?]
at org.opendaylight.netconf.sal.rest.impl.RestconfCompositeWrapper.invokeRpc(RestconfCompositeWrapper.java:64) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAc
Can we add check and throw RestconfDocumentedException so user will know that required input is missing?
eg. this works
curl -u admin:admin -X POST http://localhost:8181/restconf/operations/jsonrpc:force-refresh -d ''