Hi.
> curl -d
> '{"cookie":"1","dpid":"0000000000000049","priority":"101","match":{"in_port":"7","dl_src":"00901a400011","dl_dst":"009099400001","dl_vlan":"101","dl_vlan_pcp":"0","dl_type":"2048","nw_tos":"0","nw_proto":"17","nw_src":"30.0.0.1","nw_dst":"40.0.0.1","tp_src":"2001","tp_dst":"2001"},"actions":[{"type":"OUTPUT","port":"8","port":"9","type":"SET_VLAN_VID","vlan_vid":"2","type":"SET_DL_DST","dl_dst":"01005e0a0a0a"}]}'
> http://10.1.25.52:8080/stats/flowentry/add
"actions" is a list of actions. please try this:
(improve readability)
curl -d '{"cookie": 1,
"dpid": "0000000000000049",
"priority": "101",
"match": {"in_port": "7",
"dl_src": "00901a400011",
"dl_dst": "009099400001",
"dl_vlan": "101",
"dl_vlan_pcp": "0",
"dl_type": "2048",
"nw_tos": "0",
"nw_proto": "17",
"nw_src": "30.0.0.1",
"nw_dst": "40.0.0.1",
"tp_src": "2001",
"tp_dst": "2001"},
"actions": [{"type": "OUTPUT", "port": "8"},
{"type": "OUTPUT", "port": "9"},
{"type": "SET_VLAN_VID", "vlan_vid": "2"},
{"type": "SET_DL_DST", "dl_dst": "01005e0a0a0a"}]}'
http://10.1.25.52:8080/stats/flowentry/add
thanks.
On Wed, 22 Jan 2014 13:58:26 +0800
jalee <[email protected]> wrote:
> Dear All,
>
> Can you tell me how can I do use more actions on the restAPI at one flow
> entry? Such as: Two output port, set vlan_vid, and set dl_dst…..
>
>
>
> curl -d
> '{"cookie":"1","dpid":"0000000000000049","priority":"101","match":{"in_port":"7","dl_src":"00901a400011","dl_dst":"009099400001","dl_vlan":"101","dl_vlan_pcp":"0","dl_type":"2048","nw_tos":"0","nw_proto":"17","nw_src":"30.0.0.1","nw_dst":"40.0.0.1","tp_src":"2001","tp_dst":"2001"},"actions":[{"type":"OUTPUT","port":"8","port":"9","type":"SET_VLAN_VID","vlan_vid":"2","type":"SET_DL_DST","dl_dst":"01005e0a0a0a"}]}'
> http://10.1.25.52:8080/stats/flowentry/add
>
>
>
> Thanks,
>
>
>
> Jalee
>
>
>
> *From:*jalee [mailto:[email protected]]
> *Sent:* Monday, January 20, 2014 1:07 AM
> *To:* '[email protected]'
> *Subject:* About restAPI question
>
>
>
> DearAll,
>
> I used restAPI add flow entry, but I still see the 404 message on the
> controller, could you tell me I miss something? Please see log as below.
>
> I will use openflow 1.0 and 1.3.1 API function.
>
> Thanks,
>
>
>
> Jalee
>
>
>
> ===================================== add flow entry
>
> lab@lab-virtual-machine:~/ryu/ryu/lib$ curl -d '{"dpid": "0000000000000031",
> "priority":"32768", "match":{"in_port":"1"}, "actions":[{"port":"3"}]}'
> http://127.0.0.1:8080/stats/flowentry/add
>
> lab@lab-virtual-machine:~/ryu/ryu/lib$
>
>
>
> ===================================== controller log.
>
> lab@lab-virtual-machine:/usr/local/lib/python2.7/dist-packages/ryu/app$
> <mailto:lab@lab-virtual-machine:/usr/local/lib/python2.7/dist-packages/ryu/app$>
> ryu-manager ofctl_rest.py
>
> loading app ofctl_rest.py
>
> loading app ryu.controller.ofp_handler
>
> instantiating app None of DPSet
>
> creating context dpset
>
> creating context wsgi
>
> instantiating app ryu.controller.ofp_handler of OFPHandler
>
> instantiating app ofctl_rest.py of RestStatsApi
>
> (5400) wsgi starting up on http://0.0.0.0:8080/
>
> (5400) accepted ('127.0.0.1', 51382)
>
> 127.0.0.1 - - [20/Jan/2014 00:46:45] "POST /stats/flowentry/add HTTP/1.1" 404
> 122 0.003066
>
> (5400) accepted ('127.0.0.1', 51383)
>
> 127.0.0.1 - - [20/Jan/2014 00:46:56] "POST /stats/flowentry/add HTTP/1.1" 404
> 122 0.000631
>
>
>
> lab@lab-virtual-machine:~$ netstat -tunlp
>
> (Not all processes could be identified, non-owned process info
>
> will not be shown, you would have to be root to see it all.)
>
> Active Internet connections (only servers)
>
> Proto Recv-Q Send-Q Local Address Foreign Address State
> PID/Program name
>
> tcp 0 0 0.0.0.0:6633 0.0.0.0:* LISTEN
> 5400/python
>
> tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
> 5400/python
>
> tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
> -
>
> tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
> -
>
> tcp6 0 0 :::22 :::* LISTEN
> -
>
> tcp6 0 0 ::1:631 :::* LISTEN
> -
>
> udp 0 0 0.0.0.0:37593 0.0.0.0:*
> -
>
> udp 0 0 0.0.0.0:5353 0.0.0.0:*
> -
>
> udp 0 0 0.0.0.0:68 0.0.0.0:*
> -
>
> udp6 0 0 :::5353 :::*
> -
>
> udp6 0 0 :::34974 :::*
> -
>
> lab@lab-virtual-machine:~$
>
>
> ====================================================================================
> This message may contain information which is private, privileged or
> confidential of INNO-Tech Network & Service Inc.
> If you are not the intended recipient of this message, please notify the
> sender and destroy/delete the message.
> Any review, retransmission, dissemination or other use of, or taking of any
> action in reliance upon this information,
> by persons or entities other than the intended recipient is prohibited.
> ====================================================================================
>
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel