Skip to content

Commit

Permalink
Merge pull request #13 from amlight/fix/issue_11
Browse files Browse the repository at this point in the history
[Fix] GET /api/amlight/flow_stats/flow/stats/ not found
  • Loading branch information
viniarck authored Jan 11, 2022
2 parents 20e663d + ea21032 commit 28ac211
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ def flow_match(self, dpid):
def flow_stats(self, dpid):
"""Return all flows matching request."""
switch = self.controller.get_switch_by_dpid(dpid)
if not switch:
return f"switch {dpid} not found", 404
flows = self.match_flows(switch, format_request(request.args), True)
flows = [flow.to_dict() for flow in flows]
return jsonify(flows)
Expand Down

0 comments on commit 28ac211

Please sign in to comment.