1

I am trying to add a simple flow rule via Lithium's DLUX using the /operations/sal-flow:add-flow api call but getting nothing but errors, please can someone help?

Even a preview of a sample flow someone has added would be really helpful?

My current input as displayed in the preview frame is:

http://localhost:8181/restconf/operations/sal-flow:add-flow

{
    "add-flow": {
        "input": {
            "match": {
                "ethernet-match": {
                    "ethernet-type": {
                        "type": "2048"
                    }
                },
                "ipv4-source": "10.0.0.1/32"
            },
            "instructions": {
                "instruction": [
                    {
                        "order": "0",
                        "apply-actions": {
                            "action": [
                                {
                                    "drop-action": {},
                                    "order": "0"
                                }
                            ]
                        }
                    }
                ]
            },
            "flow-name": "test",
            "table_id": "0"
        }
    }
}

The current error is:

"Server Error : The server encountered an unexpected condition which prevented it from fulfilling the request. - : The operation encountered an unexpected error while"

The same request in Postman gives the error:

{
  "errors": {
    "error": [
      {
        "error-type": "protocol",
        "error-tag": "malformed-message",
        "error-message": "Error parsing input: Schema node with name add-flow wasn't found under (urn:opendaylight:flow:service?revision=2013-08-19)add-flow."
      }
    ]
  }
}

I have seen examples using xml but nothing that seems to work. I am able to view the network topology via dlux so I presume I am connected to everything ok.

Many thanks in advance.

alex321
  • 11
  • 2

2 Answers2

0

Remove the add-flow and the corresponding brackets from the input data. Use things like

{
    input: {...},
    output: {...}
}
Emiapwil
  • 56
  • 3
0

I am having the same problem using DLUX. Anyway I managed to find a solution using XML POST requests from this link https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:End_to_End_Flows. You can use POSTMAN application on Chrome to send requests. The body of the request should be something like:

POST http://localhost:8080/restconf/operations/sal-flow:add-flow

Add authentication header too.

Content-type: application/xml

Accept: application/xml

Body:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<input xmlns="urn:opendaylight:flow:service">
   <barrier>false</barrier>
   <node xmlns:inv="urn:opendaylight:inventory">/inv:nodes/inv:node[inv:id="openflow:1"]</node>

   <cookie>55</cookie>
   <flags>SEND_FLOW_REM</flags>
   <hard-timeout>0</hard-timeout>
   <idle-timeout>0</idle-timeout>
   <installHw>false</installHw>
   <match>
    <ethernet-match>
     <ethernet-type>
       <type>2048</type>
     </ethernet-type>
    </ethernet-match>
    <ipv4-destination>10.0.10.2/32</ipv4-destination>
   </match>
   <instructions>
    <instruction>
     <order>0</order>
     <apply-actions>
       <action>
         <output-action>
           <output-node-connector>1</output-node-connector>
         </output-action>
         <order>0</order>
       </action>
     </apply-actions>
    </instruction>
   </instructions>
   <priority>0</priority>
   <strict>false</strict>
   <table_id>0</table_id>
</input>
poli mi
  • 21
  • 1
  • 5