[VTN-77] Unable to determine actual type of VTN flow match/action via RESTCONF. Created: 17/Jun/15  Updated: 19/Oct/17  Resolved: 18/Jun/15

Status: Resolved
Project: vtn
Component/s: VTN Manager
Affects Version/s: unspecified
Fix Version/s: None

Type: Bug
Reporter: Shigeru Yasuda Assignee: Unassigned
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: 3789

 Description   

Some VTN flow data models are defined using YANG choice statement.

  • layer-4 flow match (vtn-layer4-match)
  • flow action (vtn-action)

Branch name of YANG choice does not appear in XML/JSON serialized data.
So REST client cannot determine actual type of layer-4 flow match and flow action if it obtains those data via RESTCONF.

For example, a data-flow-action list which contains a vtn-pop-vlan-action will be converted to JSON notation like this:

"data-flow-action": [

{ "order": 0 }

],

REST client cannot determine the actual type of above action because no type information appears.

VTN YANG models defined by choice statement should be modified as follows:

  • Every vtn-action case should contain an inner container which indicates the actual type.
    For example, vtn-pop-vlan-action should be defined as follows.

case vtn-pop-vlan-action-case {
container vtn-pop-vlan-action {}
}

The name of the container always appears in XML/JSON serialized data.
So a data-flow-action list which contains a vtn-pop-vlan-action will be converted to JSON as follows.

"data-flow-action": [
{
"order": 0,
"vtn-pop-vlan-action": {}
}
],

  • The name of inner field in vtn-layer4-match case should have a prefix which indicates the actual type.
    For example, vtn-icmp-match-fields should be defined as follows.

grouping vtn-icmp-match-fields {
leaf icmp-type

{ type uint8; }
leaf icmp-code { type uint8; }

}

A data-flow-match which contains a vtn-icmp-match will be converted to JSON as follows.

"data-flow-match": {
"icmp-code": 0,
"icmp-type": 8,
"vtn-ether-match":

{ "ether-type": 2048, }

,
"vtn-inet-match":

{ "protocol": 1 }

},

REST client can determine ICMP match conditions by "icmp-" prefix in field name.



 Comments   
Comment by Shigeru Yasuda [ 17/Jun/15 ]

https://git.opendaylight.org/gerrit/22817 (master)

Comment by Hideyuki Tai [ 17/Jun/15 ]

https://git.opendaylight.org/gerrit/22838 (stable/lithium)

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