Skip to content
Snippets Groups Projects
Commit da00392d authored by Ryan Izard's avatar Ryan Izard
Browse files

Verified all REST APIs except Firewall and VirtualNetworkFilter. Added JSON...

Verified all REST APIs except Firewall and VirtualNetworkFilter. Added JSON return for clearing SFP flows.
parent 4ca163ce
No related branches found
No related tags found
No related merge requests found
......@@ -182,7 +182,7 @@ public class LoadBalancer implements IFloodlightModule,
private net.floodlightcontroller.core.IListener.Command processPacketIn(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx) {
Ethernet eth = IFloodlightProviderService.bcStore.get(cntx, IFloodlightProviderService.CONTEXT_PI_PAYLOAD);
IPacket pkt = eth.getPayload();
IPacket pkt = eth.getPayload();
if (eth.isBroadcast() || eth.isMulticast()) {
// handle ARP for VIP
......
......@@ -29,8 +29,8 @@ import org.slf4j.LoggerFactory;
public class ClearStaticFlowEntriesResource extends ServerResource {
protected static Logger log = LoggerFactory.getLogger(ClearStaticFlowEntriesResource.class);
@Get
public void ClearStaticFlowEntries() {
@Get("json")
public String ClearStaticFlowEntries() {
IStaticFlowEntryPusherService sfpService =
(IStaticFlowEntryPusherService)getContext().getAttributes().
get(IStaticFlowEntryPusherService.class.getCanonicalName());
......@@ -41,13 +41,15 @@ public class ClearStaticFlowEntriesResource extends ServerResource {
if (param.toLowerCase().equals("all")) {
sfpService.deleteAllFlows();
return "{\"status\":\"Deleted all flows.\"}";
} else {
try {
sfpService.deleteFlowsForSwitch(DatapathId.of(param));
return "{\"status\":\"Deleted all flows for switch " + param + ".\"}";
} catch (NumberFormatException e){
setStatus(Status.CLIENT_ERROR_BAD_REQUEST,
ControllerSwitchesResource.DPID_ERROR);
return;
return "'{\"status\":\"Could not delete flows requested! See controller log for details.\"}'";
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment