Ask Your Question
0

Could not add flow via Rest API.

asked 2015-08-05 03:37:41 -0700

anonymous user

Anonymous

updated 2015-08-17 03:10:32 -0700

[edit] Ignore this one. The json format flow copy from YANG UI sal-flow, but can not work thru. At last I tried to use XML format flow. A related question resolved this issue.

I use postman to post add-flow, but it failed. Could anyone tell what have I missed?

POST: http://{my-controller}/restconf/operations/sal-flow:add-flow Body

enter code here{
"add-flow": {
    "input": {
        "match": {
            "in-port": "1"
        },
        "instructions": {
            "instruction": [
                {
                    "write-actions": {
                        "action": [
                            {
                                "set-field": {
                                    "tunnel": {
                                        "tunnel-id": "100"
                                    }
                                }
                            }
                        ]
                    }
                }
            ]
        },
        "table_id": "0",
        "node": "openflow:112662899537729"
    }
}

}

Return message:

enter code here { "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."}]}
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-08-05 04:13:39 -0700

balaodl gravatar image

TIPs: 1. before using psotman, just try it with from Resconf UI. 2. take care of the exact syntax before posting

edit flag offensive delete publish link more

Comments

You're right. The body part is copy from Restconf UI. When I try with Yang UI Module(the sal-flow rev.2013-08-19) , it alsoe responses error like " Error parsing input: Could not parse Instance Identifier 'openflow:112662899537729'. Then I copy it and try with postman as above.

nevalosa ( 2015-08-05 18:31:46 -0700 )edit
0

answered 2015-08-17 03:06:39 -0700

nevalosa gravatar image

Refer this post. The json format is incorrect, at last, I translate json to XML, because there are more examples we can learn from.

edit flag offensive delete publish link more
Login/Signup to Answer

Stats

Asked: 2015-08-05 03:37:41 -0700

Seen: 558 times

Last updated: Aug 17 '15