[CONTROLLER-1367] Rpc via restconf using json returns "Error parsing input: Incorrec nesting caused by parser." Created: 11/Jun/15  Updated: 12/Jun/15  Resolved: 12/Jun/15

Status: Resolved
Project: controller
Component/s: restconf
Affects Version/s: Lithium
Fix Version/s: None

Type: Bug
Reporter: Michal Rehak Assignee: Vaclav Demcak
Resolution: Cannot Reproduce 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: 3672

 Description   

The same rpc invocation via restconf using xml works. Nothing appeared in karaf.log (root set to INFO).

This is working xml input:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<input xmlns="urn:opendaylight:bulk-flow:service">

<bulk-flow-item>

<node xmlns:inv="urn:opendaylight:inventory">/inv:nodes/inv:node[inv:id="openflow:1"]</node>
<table_id>0</table_id>

<cookie>142</cookie>
<priority>0</priority>
<strict>false</strict>
<flags>SEND_FLOW_REM</flags>
<hard-timeout>0</hard-timeout>
<idle-timeout>0</idle-timeout>
<instructions>
<instruction>
<apply-actions>
<action>
<dec-nw-ttl/>
<order>0</order>
</action>
</apply-actions>
<order>0</order>
</instruction>
</instructions>
<match>
<ethernet-match>
<ethernet-type>
<type>2048</type>
</ethernet-type>
</ethernet-match>
<ipv4-destination>10.0.1.0/24</ipv4-destination>
</match>
</bulk-flow-item>
</input>

This is corresponding json (not working):
{"input": [
{"bulk-flow-item": {
"node": "/opendaylight-inventory:nodes/node[opendaylight-inventory:id=\"openflow:1\"]",
"cookie": 142,
"flags": "SEND_FLOW_REM",
"hard-timeout": 0,
"idle-timeout": 0,
"instructions": {
"instruction": [{
"apply-actions": {
"action": [
{
"dec-nw-ttl": {},
"order": 0
}
]
},
"order": 0
}]
},
"match": {
"ethernet-match": {
"ethernet-type":

{ "type": 2048 }

},
"ipv4-destination": "10.0.4.0/24"
},
"priority": 0,
"table_id": 0
}}
]}



 Comments   
Comment by Tony Tkacik [ 11/Jun/15 ]

dec-nw-ttl is modeled as container or type empty?

Comment by Michal Rehak [ 12/Jun/15 ]

case dec-nw-ttl-case {
container dec-nw-ttl {
}
}

Comment by Michal Rehak [ 12/Jun/15 ]

Actually there were 2 typos:

  • in json there no list of bulk-flow-item elements (as in xml), but bulk-flow-item contains list of data objects
  • "node": "/opendaylight-inventory:nodes/node[opendaylight-inventory:id=\"openflow:1\"]"

should be:

"node": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id=\"openflow:1\"]"

Now it works, sorry for false alarm.

Generated at Wed Feb 07 19:55:22 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.