Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

0

How to POST a flow with Postman

asked 2015-05-19 13:45:12 -0700

FHLDeveloper gravatar image

updated 2015-05-19 13:51:08 -0700

Hello!

I'm trying to post a flow using the Chrome extension Postman and I am getting "403 Forbidden" returned

The URL I am using is: http://10.0.0.104:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1

With the Header Parameters:

  • Accept: application/xml
  • Content-Type: application/xml
  • Authorization Basic SDOFIWIUHSRI=

I've also tried using normal and specifying the username and password for authorization. That has not worked as well.

Lastly, the data is raw: <flow xmlns="urn:opendaylight:flow:inventory"> <priority>2</priority> <flow-name>TestFlow1</flow-name> <match> <ethernet-match> <ethernet-type> <type>2048</type> </ethernet-type> </ethernet-match> <ipv4-destination>10.0.0.2/24</ipv4-destination> </match> <id>1</id> <table_id>0</table_id> <instructions> <instruction> <order>0</order> <apply-actions> <action> <order>0</order> <dec-nw-ttl> </dec-nw-ttl></action> </apply-actions> </instruction> </instructions> </flow>

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-08-29 01:09:04 -0700

happysmile gravatar image

updated 2015-08-29 01:12:00 -0700

In this way you must PUT your flow, POST ing it makes probelm. check your method.

read here for POST vs PUT

edit flag offensive delete publish link more
0

answered 2015-05-19 23:14:01 -0700

updated 2015-05-19 23:15:08 -0700

The flow content is wrong. If you try to install the flow :

<flow xmlns="urn:opendaylight:flow:inventory"> 
    <priority>2</priority> 
     <flow-name>TestFlow1</flow-name> 
  <match> 
    <ethernet-match> 
      <ethernet-type> 
        <type>2048</type> 
      </ethernet-type> 
    </ethernet-match> 
    <ipv4-destination>10.0.0.2/24</ipv4-destination> 
  </match> 
  <id>1</id> 
  <table_id>0</table_id> 
  <instructions> 
    <instruction> 
      <order>0</order> 
      <apply-actions> 
        <action> 
          <order>0</order> 
          <dec-nw-ttl> </dec-nw-ttl>    # problem is here 
        </action> 
      </apply-actions> 
    </instruction> 
  </instructions> 
</flow>

Error Response :

{
    "errors": {
        "error": [
            {
                "error-type": "protocol",
                "error-tag": "invalid-value",
                "error-message": "Unhandled parameter types: [container dec-nw-ttl]"
            }
        ]
    }
}

The correct way of sending the flow using postman is :

url : http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:108777412405314/table/0/flow/1

Headers: Content-Type: Application/xml

Body:

<flow xmlns="urn:opendaylight:flow:inventory"> 
    <priority>2</priority> 
     <flow-name>TestFlow1</flow-name> 
  <match> 
    <ethernet-match> 
      <ethernet-type> 
        <type>2048</type> 
      </ethernet-type> 
    </ethernet-match> 
    <ipv4-destination>10.0.0.2/24</ipv4-destination> 
  </match> 
  <id>1</id> 
  <table_id>0</table_id> 
  <instructions> 
    <instruction> 
      <order>0</order> 
      <apply-actions> 
        <action> 
          <order>0</order> 
          <dec-nw-ttl/>
        </action> 
      </apply-actions> 
    </instruction> 
  </instructions> 
</flow>

send it and you will get the response code 200 !!

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

Question Tools

Follow
1 follower

Stats

Asked: 2015-05-19 13:45:12 -0700

Seen: 2,900 times

Last updated: Aug 29 '15