blob: e785a6947f93d73a294d0ae022a23d3d12414155 [file] [log] [blame]
Ray Milkeybba71382015-08-26 13:09:23 -07001#! /usr/bin/env python
2
3import requests
4
5from requests.auth import HTTPBasicAuth
6
7r = requests.get('http://192.168.56.101:8181/onos/v1/flows', auth=HTTPBasicAuth('onos', 'rocks'))
8deviceId = "of:0000000000000001"
9port = 4
10flowsJson = r.json()
11
12for flow in flowsJson["flows"]:
13 if deviceId == flow["deviceId"]:
14 if flow["treatment"]["instructions"][0]["port"] == port:
15 print flow
16
17
18
19