Add multipart reply deserializers
[openflowplugin.git] / model / model-flow-statistics / src / main / yang / opendaylight-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 opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
7     import opendaylight-flow-types {prefix flow-types;revision-date "2013-10-26";}
8     import opendaylight-statistics-types {prefix stat-types;revision-date "2013-09-25";}
9     import opendaylight-table-types {prefix table-types;revision-date "2013-10-26";}
10     import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";}
11     import flow-capable-transaction {prefix tr;}
12     import ietf-inet-types {prefix inet; revision-date "2013-07-15";}
13     import opendaylight-multipart-types { prefix multipart; revision-date "2017-01-12"; }
14
15     description "Openflow statistics polling.";
16
17     revision "2013-08-19" {
18         description "Initial revision of flow statistics service";
19     }
20
21     augment "/inv:nodes/inv:node/flow-node:table/flow-node:flow" {
22         ext:augment-identifier "flow-statistics-data";
23         description "Openflow flow statistics data into the flow-capable-node->table->flow";
24
25         uses flow-statistics;
26     }
27
28     grouping flow-statistics {
29         container flow-statistics {
30             uses stat-types:generic-statistics;
31         }
32     }
33
34     typedef flow-id {
35         description "flow id, TODO:: replace with inv:flow-id.";
36         type inet:uri;
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         status deprecated;
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         status deprecated;
72         description "Fetch statistics of all the flow present in the specific flow table of the switch";
73         input {
74             uses inv:node-context-ref;
75             leaf table-id {
76                 type table-types:table-id;
77             }
78         }
79         output {
80             uses flow-and-statistics-map-list;
81             uses tr:transaction-aware;
82         }
83     }
84
85     rpc get-flow-statistics-from-flow-table {
86         status deprecated;
87         description "Fetch statistics of the specific flow present in the specific flow table of the switch";
88         input {
89             uses inv:node-context-ref;
90             uses flow-types:flow;
91         }
92         output {
93             uses flow-and-statistics-map-list;
94             uses tr:transaction-aware;
95         }
96     }
97
98     notification flows-statistics-update {
99         status deprecated;
100         description "Flows statistics sent by switch";
101         leaf moreReplies {
102             type boolean;
103         }
104         uses inv:node;
105         uses flow-and-statistics-map-list;
106         uses tr:transaction-aware;
107     }
108
109     //Models for aggregate flow statistics collection
110     augment "/inv:nodes/inv:node/flow-node:table" {
111         status deprecated;
112         ext:augment-identifier "aggregate-flow-statistics-data";
113         uses aggregate-flow-statistics;
114     }
115
116     grouping aggregate-flow-statistics {
117         container aggregate-flow-statistics {
118             uses stat-types:aggregate-flow-statistics;
119         }
120     }
121
122     // RPC calls to fetch aggregate flow statistics
123     rpc get-aggregate-flow-statistics-from-flow-table-for-all-flows {
124         status deprecated;
125         description "Fetch aggregate statistics for all the flows present in the specific flow table of the switch";
126
127         input {
128             uses inv:node-context-ref;
129             leaf table-id {
130                 type table-types:table-id;
131             }
132         }
133         output {
134             uses stat-types:aggregate-flow-statistics;
135             uses tr:transaction-aware;
136         }
137     }
138
139     rpc get-aggregate-flow-statistics-from-flow-table-for-given-match {
140         description "Fetch aggregate statistics for flows filtered by
141           - table (eventually all tables)
142           - match
143           - port
144           - group
145           - cookie
146           This values are contained in flow (among others).
147           TODO:: filter values should be modeled more exact - omitting unusable fields.";
148
149         input {
150             uses inv:node-context-ref;
151             uses flow-types:flow;
152         }
153         output {
154             list aggregated-flow-statistics {
155                 uses stat-types:aggregate-flow-statistics;
156             }
157             uses tr:transaction-aware;
158         }
159     }
160
161     notification aggregate-flow-statistics-update {
162         status deprecated;
163
164         description "Aggregate flow statistics for a table, sent by switch";
165         uses inv:node;
166         uses stat-types:aggregate-flow-statistics;
167         uses tr:multipart-transaction-aware;
168     }
169
170     augment "/multipart:multipart-reply/multipart:multipart-reply-body" {
171         case multipart-reply-flow-stats {
172             uses flow-and-statistics-map-list;
173         }
174
175         case multipart-reply-flow-aggregate-stats {
176             uses stat-types:aggregate-flow-statistics;
177         }
178     }
179 }