Changes between Version 6 and Version 7 of Internal/OpenFlow/Controllers/BigSwitch


Ignore:
Timestamp:
May 16, 2011, 2:41:50 AM (14 years ago)
Author:
akoshibe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/OpenFlow/Controllers/BigSwitch

    v6 v7  
    122122HTTP PUT messages are used to modify flows. The basic syntax is as follows:
    123123
    124  `curl -X [PUT|DELETE] -d '{"config-params"}' http://localhost:8000/rest/parameter-to-change/`
     124 `curl -X PUT -d '{"config-params"}' http://localhost:8000/rest/parameter-to-change/`
    125125
    126 where `config-params` is in JSON format and the options based on `dpctl` parameters. 
     126where `config-params` is in JSON format and the options based on `dpctl` parameters. For example, to create a flow named "testflow" which redirects pings from address 10.18.1.1 to port 0/29 on switch of DPID 00:00:00:10:10:25:32:35: 
     127{{{
     128bsn@kvm-big:~$ curl -X PUT -d '{"name":"testflow","active":"True","src-ip":"10.18.1.1","ether-type":"2048",
     129"switch":"00:00:00:10:10:25:32:35","actions":"output=29"}' http://localhost:8000/rest/flow-entry/ <hit enter>
     130savedbsn@kvm-big:~$
     131}}}
     132And sure enough, if you check back with the CLI:
     133{{{
     134kvm-big> sh run
     135 ...
    127136
     137!
     138switch 00:00:00:10:10:25:32:35
     139  flow-entry testflow
     140    active True
     141    ether-type 2048
     142    src-ip 10.18.1.1
     143    actions output=29
     144!
     145
     146...
     147}}}
     148Deleting the flow utilizes the DELETE message:
     149
     150 `curl -X http://localhost:8000/rest/parameter-to-delete/` 
     151
     152Removing our flow above, therefore, requires this command:
     153{{{
     154bsn@kvm-big:~$ curl -X DELETE http://localhost:8000/rest/flow-entry/testflow/  <hit enter>
     155deletedbsn@kvm-big:~$
     156}}}
     157
     158[[BR]][[BR]]
    128159
    129160^1 Last time I played with IOS I remember you can do `run <full command>` in order to run out-of-context commands. But, I'm not a CCNA so I might be lying.^