Ask Your Question
0

It is possible to add a flow by with curl by http://localhost:8080/controller/nb/v2/flowprogrammer/default/node/...

asked 2015-06-12 07:49:44 -0700

Edu gravatar image

In the Hidrogen release it was possible to add a flow by this way:

controller> curl -u admin:admin -H 'Content-type: application/json' -X PUT -d '{"installInHw":"true", "name":"flow1", "node": {"id":"00:00:00:00:00:00:00:02", "type":"OF"}, "ingressPort":"2", "etherType": "0x800", "protocol": "6", "tpDst": "80", "priority":"65535","actions":["DROP"]}' 'http://localhost:8080/controller/nb/v2/flowprogrammer/default/node/OF/00:00:00:00:00:00:00:02/staticFlow/flow1'

I cannot get it with helium release. If it is possible, which bundles I have to download?

Thank you very much.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2015-06-12 13:26:23 -0700

jpete2477 gravatar image

Helium changes how the API's work. Check out the documentation here:

https://wiki.opendaylight.org/view/OpenDaylightOpenFlowPlugin:EndtoEndFlows#Pushyour_flow

You also have to enable the right feature using karaf. Here's a link on using karaf:

https://wiki.opendaylight.org/view/Karaf:StepbyStep_Guide

You'll want to do the following from the karaf console:

feature:install odl-restconf-all

edit flag offensive delete publish link more
0

answered 2015-06-30 04:12:46 -0700

Edu gravatar image

updated 2015-06-30 04:45:15 -0700

Thanks for your answer! But anyway I cannot get my purpose. I was installing by a Java code some flows in the previous release of ODL. For example this one:

<list>
<flowConfig>
     <installInHw>true</installInHw>
     <name>FlowInsert1</name>
     <node>
           <id>00:00:00:00:00:00:00:01</id>
           <type>OF</type>
     </node>
     <ingressPort>1</ingressPort>
     <priority>999</priority>
     <actions>OUTPUT=2</actions>
</flowConfig>

I was installing it by a script like that that creates a JSON:

public static void main(String[] args) throws JSONException {
    JSONObject postData = new JSONObject();
    postData.put("name", "FlowInsert1");
    postData.put("installInHw", "true");postData.put("priority", "999");
    postData.put("ingressPort", "2");
    JSONArray accio = new JSONArray();
    postData.put("actions", accio.put("OUTPUT=1"));
    JSONObject node = new JSONObject();
    node.put("id", "00:00:00:00:00:00:00:01");
    node.put("type", "OF");
    postData.put("node", node);
    RestInterfaceSender.installFlow("00:00:00:00:00:00:00:01", "FlowInsert1", postData);
}

And then another script that just creates the conexion with: http://192.168.56.101:8080/controller/nb/v2/flowprogrammer/default/node/OF/00:00:00:00:00:00:00:01/staticFlow/FlowInsert1

I would really like to install the same flow with the new REST interface for helium but I don't get it. I'm trying to install this flow by POSTMAN before to try it by a JAVA app, but doesn't work:

here the image of the flow that I don't know how to put a JSON code in this foro: http://s10.postimg.org/525d1oxex/flowenhelium.png

It installs the flow but is like OF didn't saw it.

Any suggestions? Thank you! Edu

edit flag offensive delete publish link more

Comments

hi edu, have you able to do that? i want to do it too. thank you edu

ryandahp ( 2015-11-12 18:24:48 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-06-12 07:49:44 -0700

Seen: 627 times

Last updated: Jun 30 '15