blob: 90ab17eb28284c8e9e35f6c63923444eb669fc3d [file] [log] [blame]
Zsolt Harasztia8789e02016-12-14 01:55:43 -08001#!/usr/bin/env python
2import os
3import sys
4
5from scripts.scriptbase import ScriptBase
6
7
8class _(ScriptBase):
9
10 usage = """
11Usage: {} <logical-device-id>
12
13Make sure you have VOLTHA_BASE_URL environment variable
14defined, examples:
15
16export VOLTHA_BASE_URL=http://localhost:8881/api/v1
17
18or
19
20export VOLTHA_BASE_URL=http://10.100.192.220:8881/api/v1
21""".format(sys.argv[0])
22
23 def main(self):
24
25 if len(sys.argv) != 2:
26 self.err(1)
27
28 logical_device_id = sys.argv[1]
29
30 logical_device = self.fetch_logical_device_info(
31 self.voltha_base_url, logical_device_id)
32 self.print_flows(
33 'Logical device',
34 logical_device_id,
35 type='n/a',
36 flows=logical_device['flows']['items'],
37 groups=logical_device['flow_groups']['items']
38 )
39
40
41if __name__ == '__main__':
42 _().main()
43