This commit contains following changes
[controller.git] / opendaylight / md-sal / model / model-flow-statistics / src / main / yang / flow-statistics.yang
1 module opendaylight-flow-statistics {
2     namespace "urn:opendaylight:flow:statistics";
3     prefix flowstat;
4
5     import yang-ext {prefix ext; revision-date "2013-07-09";}
6     import ietf-yang-types {prefix yang; revision-date "2010-09-24";}   
7     import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
8     import opendaylight-flow-types {prefix flow-types;revision-date "2013-10-26";}
9     import opendaylight-statistics-types {prefix stat-types;revision-date "2013-09-25";}
10     import opendaylight-table-types {prefix table-types;revision-date "2013-10-26";}
11     import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";}
12     import flow-capable-transaction {prefix tr;}
13     import sal-flow {prefix flow;}
14     
15
16     revision "2013-08-19" {
17         description "Initial revision of flow statistics service";
18     }
19         
20         //Augment flow statistics data to the flow-capable-node->table->flow
21         augment "/inv:nodes/inv:node/flow-node:table/flow-node:flow" {
22         ext:augment-identifier "flow-statistics-data";
23         uses flow-statistics;
24     }
25         
26         grouping flow-statistics {
27         container flow-statistics {
28             //config "false";
29                 uses flow-types:flow;
30                 uses stat-types:generic-statistics;
31         }
32         }    
33         
34         typedef flow-id {
35                 description "flow id";
36                 type yang:counter32;
37         }
38         
39         grouping flow-and-statistics-map-list {
40                 description "List of flow and statistics map";
41                 list flow-and-statistics-map-list {
42                         key "flow-id";
43                         leaf flow-id {
44                                 type flow-id;
45                         }
46                         uses flow-and-statistics-map;
47                 }
48         }
49         
50         grouping flow-and-statistics-map{
51                 description "Mapping between flow and its statistics";
52                 uses flow-types:flow;
53                 uses stat-types:generic-statistics;
54         }
55         
56     // RPC calls to fetch flow statistics
57     rpc get-all-flows-statistics-from-all-flow-tables {
58         description "Fetch statistics of all the flow present in all the flow tables of the switch"; 
59         input {
60             uses inv:node-context-ref;
61         }
62         output {
63             uses flow-and-statistics-map-list;
64             uses tr:transaction-aware;
65         }
66     
67     }
68
69     rpc get-all-flow-statistics-from-flow-table {
70         description "Fetch statistics of all the flow present in the specific flow table of the switch"; 
71         input {
72             uses inv:node-context-ref;
73             leaf table-id {
74                 type table-types:table-id;
75             }
76         }
77         output {
78             uses flow-and-statistics-map-list;
79             uses tr:transaction-aware;
80         }
81     }
82
83     rpc get-flow-statistics-from-flow-table {
84         description "Fetch statistics of the specific flow present in the specific flow table of the switch"; 
85         input {
86             uses inv:node-context-ref;
87             uses flow-types:flow;
88         }
89         output {
90             uses flow-and-statistics-map-list;
91             uses tr:transaction-aware;
92         }
93     }
94
95     notification flows-statistics-update {
96         description "Flows statistics sent by switch";
97                 leaf moreReplies {
98             type boolean;
99         }
100         uses inv:node;
101                 uses flow-and-statistics-map-list;
102                 uses tr:transaction-aware;
103     }
104
105         //Models for aggregate flow statistics collection
106         augment "/inv:nodes/inv:node/flow-node:table" {
107         ext:augment-identifier "aggregate-flow-statistics-data";
108         uses aggregate-flow-statistics;
109     }
110         
111         grouping aggregate-flow-statistics {
112         container aggregate-flow-statistics {
113             //config "false";
114                 uses stat-types:aggregate-flow-statistics;
115         }
116         }    
117         
118     // RPC calls to fetch aggregate flow statistics
119     rpc get-aggregate-flow-statistics-from-flow-table-for-all-flows {
120         description "Fetch aggregate statistics for all the flows present in the specific flow table of the switch"; 
121         input {
122             uses inv:node-context-ref;
123             leaf table-id {
124                 type table-types:table-id;
125             }
126         }
127         output {
128                 uses stat-types:aggregate-flow-statistics;
129             uses tr:transaction-aware;
130         }
131     }
132     rpc get-aggregate-flow-statistics-from-flow-table-for-given-match {
133         description "Fetch aggregate statistics for all the flow matches to the given match from the given table of the switch"; 
134         input {
135             uses inv:node-context-ref;
136             uses flow-types:flow;
137         }
138         output {
139                 uses stat-types:aggregate-flow-statistics;
140             uses tr:transaction-aware;
141         }
142     }
143
144     notification aggregate-flow-statistics-update {
145         description "Aggregate flow statistics for a table, sent by switch";
146                 leaf moreReplies {
147             type boolean;
148         }
149         uses inv:node;
150                 uses stat-types:aggregate-flow-statistics;
151                 uses tr:transaction-aware;
152     }
153 }