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