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