[CONTROLLER-119] Create group fails through RESTCONF Created: 17/Jan/14  Updated: 25/Jul/23  Resolved: 26/Jan/14

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

Type: Bug
Reporter: Deepthi V V Assignee: Deepthi V V
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Windows
Platform: PC


Issue Links:
Blocks
is blocked by YANGTOOLS-75 key from ListSchemaNode has different... Resolved
Duplicate
is duplicated by CONTROLLER-85 RESTCONF not passing any values throu... Resolved
External issue ID: 321

 Description   

Unable to create group through RESTCONF:
URL:
http://localhost:8080/restconf/config/opendaylight-inventory:nodes
/node/openflow:1/groups/group/100

Request:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<group xmlns="urn:opendaylight:flow:inventory">
<group-type xmlns="urn:opendaylight:group:types">group-select</group-type>
<group-id xmlns="urn:opendaylight:group:types">100</group-id>
<buckets xmlns="urn:opendaylight:group:types">
<bucket>
<watch_port>1</watch_port>
<watch_group>14</watch_group>
<bucket-id>122</bucket-id>
<weight>15</weight>
<action>
<push-vlan-action>
<ethernet-type>33024</ethernet-type>
</push-vlan-action>
</action>
</bucket>
</buckets>
<group-name xmlns="urn:opendaylight:group:types">Foo-00</group-name>
<barrier xmlns="urn:opendaylight:group:types">false</barrier>
</group>

Result:
Data has bad format
If data is in XML format then namespace for group-type should be urn:opendaylight:flow:inventory.
If data is in Json format then module name for group-type should be flow-node-inventory.

Now if I remove namespace "urn:opendaylight:group:types", following exception is thrown:
java.lang.IllegalArgumentException
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:76)
at org.opendaylight.controller.sal.restconf.impl.ControllerContext.addKeyValue(ControllerContext.java:682)
at org.opendaylight.controller.sal.restconf.impl.ControllerContext.collectPathArguments(ControllerContext.java:596)
at org.opendaylight.controller.sal.restconf.impl.ControllerContext.collectPathArguments(ControllerContext.java:612)
at org.opendaylight.controller.sal.restconf.impl.ControllerContext.collectPathArguments(ControllerContext.java:612)
at org.opendaylight.controller.sal.restconf.impl.ControllerContext.toInstanceIdentifier(ControllerContext.java:160)
at org.opendaylight.controller.sal.restconf.impl.RestconfImpl.resolveInstanceIdentifier(RestconfImpl.java:384)
at org.opendaylight.controller.sal.restconf.impl.RestconfImpl.createConfigurationData(RestconfImpl.java:245)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)



 Comments   
Comment by Martin Sunal [ 20/Jan/14 ]

It seems to be depended on YANGTOOLS-75

Comment by Vaclav Demcak [ 24/Jan/14 ]

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<group>
<group-type>group-select</group-type>
<group-id>100</group-id>
<buckets>
<bucket>
<watch_port>1</watch_port>
<watch_group>14</watch_group>
<bucket-id>122</bucket-id>
<weight>15</weight>
<action>
<order>0</order>
<push-vlan-action>
<ethernet-type>33024</ethernet-type>
</push-vlan-action>
</action>
</bucket>
</buckets>
<group-name>Foo-00</group-name>
<barrier>false</barrier>
</group>

-----------------------------------------

2014-01-24 10:50:23.976 CET [md-sal-binding-commit-61] INFO o.o.o.t.OpenflowpluginGroupTestServiceProvider - addGroup - AddGroupInput [_groupRef=GroupRef [_value=InstanceIdentifier [path=[org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node[key=NodeKey [_id=Uri [_value=foo:node:1]]], org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode, org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group[key=GroupKey []]]]], _barrier=null, _buckets=null, _containerName=null, _groupId=null, _groupName=null, _groupType=null, _node=NodeRef [_value=InstanceIdentifier [path=[org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node[key=NodeKey [_id=Uri [_value=foo:node:1]]]]]], _transactionUri=Uri [_value=BA-5707], augmentation=[]]
java.lang.IllegalStateException: No routable provider is processing routed message for InstanceIdentifier [path=[org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node[key=NodeKey [_id=Uri [_value=foo:node:1]]]]]
at org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsService$$Broker$Router.getGroupDescription(OpendaylightGroupStatisticsService$$Broker$Router.java)
at org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsService$$Broker$DirectProxy.getGroupDescription(OpendaylightGroupStatisticsService$$Broker$DirectProxy.java)
at org.opendaylight.controller.md.statistics.manager.StatisticsProvider.sendGroupDescriptionRequest(StatisticsProvider.java:408)
at org.opendaylight.controller.md.statistics.manager.StatisticsUpdateHandler.onDataChanged(StatisticsUpdateHandler.java:88)
at org.opendaylight.controller.md.sal.common.impl.service.TwoPhaseCommit.publishDataChangeEvent(TwoPhaseCommit.java:131)
at org.opendaylight.controller.md.sal.common.impl.service.TwoPhaseCommit.call(TwoPhaseCommit.java:97)
at org.opendaylight.controller.md.sal.common.impl.service.TwoPhaseCommit.call(TwoPhaseCommit.java:31)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

Comment by Tony Tkacik [ 24/Jan/14 ]

Fixed in:

http://git.opendaylight.org/gerrit/4702

Also Correct for put should be:
http://localhost:8080/restconf/config/opendaylight-inventory:nodes
/node/openflow:1/group/100

Correct XML:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<group xmlns="urn:opendaylight:flow:inventory">
<group-type>group-select</group-type>
<group-id>100</group-id>
<buckets>
<bucket>
<watch_port>1</watch_port>
<watch_group>14</watch_group>
<bucket-id>122</bucket-id>
<weight>15</weight>
<action>
<order>0</order>
<push-vlan-action>
<ethernet-type>33024</ethernet-type>
</push-vlan-action>
</action>
</bucket>
</buckets>
<group-name>Foo-00</group-name>
<barrier>false</barrier>
</group>

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