import time
import json
+
class FlowConfigBlasterFLE(FlowConfigBlaster):
"""
FlowConfigBlaster, Floodlight Edition; Uses the Floodlight Static Flow Entry Pusher REST API to inject flows.
# Create the service URL
self.url = 'http://' + self.host + ":" + self.port + '/wm/staticflowentrypusher/json'
-
def get_num_nodes(self, session):
"""
Determines the number of nodes in the network. Overrides the get_num_nodes method in FlowConfigBlaster.
return nodes
-
- def add_flow(self, session, node, flow_id, ipaddr):
+ def post_flows(self, session, node, flow_id, ipaddr):
"""
Adds a flow. Overrides the add_flow method in FlowConfigBlaster.
:param session:
r = session.post(self.url, data=flow_data, headers=self.putheaders, stream=False)
return r.status_code
-
def delete_flow(self, session, node, flow_id):
"""
Deletes a flow. Overrides the delete_flow method in FlowConfigBlaster.
in_args = parser.parse_args()
-
fct = FlowConfigBlasterFLE(in_args.host, in_args.port, in_args.cycles, in_args.threads, in_args.nodes,
in_args.flows, in_args.startflow)