Changes between Version 6 and Version 7 of Internal/OpenFlow/Controllers/BigSwitch
- Timestamp:
- May 16, 2011, 2:41:50 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Internal/OpenFlow/Controllers/BigSwitch
v6 v7 122 122 HTTP PUT messages are used to modify flows. The basic syntax is as follows: 123 123 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/` 125 125 126 where `config-params` is in JSON format and the options based on `dpctl` parameters. 126 where `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 {{{ 128 bsn@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> 130 savedbsn@kvm-big:~$ 131 }}} 132 And sure enough, if you check back with the CLI: 133 {{{ 134 kvm-big> sh run 135 ... 127 136 137 ! 138 switch 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 }}} 148 Deleting the flow utilizes the DELETE message: 149 150 `curl -X http://localhost:8000/rest/parameter-to-delete/` 151 152 Removing our flow above, therefore, requires this command: 153 {{{ 154 bsn@kvm-big:~$ curl -X DELETE http://localhost:8000/rest/flow-entry/testflow/ <hit enter> 155 deletedbsn@kvm-big:~$ 156 }}} 157 158 [[BR]][[BR]] 128 159 129 160 ^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.^