floodlight控制器中通过REST API下发流表遇到的坑

floodlight version 不同会影响REST API 的写法:

floodlightV1.0以上按这个规范写

REST API ADD/DEL形式 : /wm//json

master 分支时候 module 值为:staticentrypusher

形式为

curl -X POST -d '{"switch":"00:00:00:00:00:00:00:01", "name":"flow-mod-1", "cookie":"0", "priority":"32768", "in_port":"1","active":"true", "actions":"output=2"}' http://<controller_ip>:8080/wm/staticentrypusher/json

例子

curl -X POST -d '{"switch":"00:00:e6:06:47:2e:fb:48", "name":"flow-mod-1", "cookie":"0", "priority":"32768", "in_port":"100","active":"true", "actions":"output=2"}' http://192.168.56.101:8080/wm/staticentrypusher/json

floodlight的V1.0-v1.2 分支 , module为:staticflowpusher;形式还是跟上面一样,只是最后module值要改成staticflowpusher。我自己的一开始老是添加不进REST API就是因为我floodlight分支还是master。切换为V1.0后马上可以了。

例子

curl -X POST -d '{"switch":"00:00:e6:06:47:2e:fb:48", "name":"flow-mod-1", "cookie":"0", "priority":"32768", "in_port":"100","active":"true", "actions":"output=flood"}
' http://192.168.56.101:8080/wm/staticflowpusher/json

floodlight preV1.0之前的版本使用这个参考

v0.91 -old version
module :staticflowentrypusher

形式

curl -d '{"switch": "00:00:00:00:00:00:00:01", "name":"flow-mod-1", "priority":"32768", "ingress-port":"1","active":"true", "actions":"output=2"}' http://<controller_ip>:8080/wm/staticflowentrypusher/json

例子

curl -d '{"switch": "00:00:e6:06:47:2e:fb:48", "name":"flow-mod-1", "priority":"32768", "ingress-port":"1","active":"true", "actions":"output=2"}' http://192.168.56.101:8080:8080/wm/staticflowentrypusher/json
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章