BUG-9223:Remove hardcoded value of lldp interval
[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
14     description "Openflow statistics polling.";
15
16     revision "2013-08-19" {
17         description "Initial revision of flow statistics service";
18     }
19
20     augment "/inv:nodes/inv:node/flow-node:table/flow-node:flow" {
21         ext:augment-identifier "flow-statistics-data";
22         description "Openflow flow statistics data into the flow-capable-node->table->flow";
23
24         uses flow-statistics;
25     }
26
27     grouping flow-statistics {
28         container flow-statistics {
29             uses stat-types:generic-statistics;
30         }
31     }
32
33     typedef flow-id {
34         description "flow id, TODO:: replace with inv:flow-id.";
35         type inet:uri;
36     }
37
38     grouping flow-and-statistics-map-list {
39         description "List of flow and statistics map";
40         list flow-and-statistics-map-list {
41             key "flow-id";
42             leaf flow-id {
43                 type flow-id;
44             }
45             uses flow-and-statistics-map;
46         }
47     }
48
49     grouping flow-and-statistics-map{
50         description "Mapping between flow and its statistics";
51         uses flow-types:flow;
52         uses stat-types:generic-statistics;
53     }
54
55     // RPC calls to fetch flow statistics
56     rpc get-all-flows-statistics-from-all-flow-tables {
57         status deprecated;
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         status deprecated;
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         status deprecated;
86         description "Fetch statistics of the specific flow present in the specific flow table of the switch";
87         input {
88             uses inv:node-context-ref;
89             uses flow-types:flow;
90         }
91         output {
92             uses flow-and-statistics-map-list;
93             uses tr:transaction-aware;
94         }
95     }
96
97     notification flows-statistics-update {
98         status deprecated;
99         description "Flows statistics sent by switch";
100         leaf moreReplies {
101             type boolean;
102         }
103         uses inv:node;
104         uses flow-and-statistics-map-list;
105         uses tr:transaction-aware;
106     }
107
108     //Models for aggregate flow statistics collection
109     augment "/inv:nodes/inv:node/flow-node:table" {
110         status deprecated;
111         ext:augment-identifier "aggregate-flow-statistics-data";
112         uses aggregate-flow-statistics;
113     }
114
115     grouping aggregate-flow-statistics {
116         container aggregate-flow-statistics {
117             uses stat-types:aggregate-flow-statistics;
118         }
119     }
120
121     // RPC calls to fetch aggregate flow statistics
122     rpc get-aggregate-flow-statistics-from-flow-table-for-all-flows {
123         status deprecated;
124         description "Fetch aggregate statistics for all the flows present in the specific flow table of the switch";
125
126         input {
127             uses inv:node-context-ref;
128             leaf table-id {
129                 type table-types:table-id;
130             }
131         }
132         output {
133             uses stat-types:aggregate-flow-statistics;
134             uses tr:transaction-aware;
135         }
136     }
137
138     rpc get-aggregate-flow-statistics-from-flow-table-for-given-match {
139         description "Fetch aggregate statistics for flows filtered by 
140           - table (eventually all tables)
141           - match
142           - port
143           - group
144           - cookie
145           This values are contained in flow (among others).
146           TODO:: filter values should be modeled more exact - omitting unusable fields.";
147
148         input {
149             uses inv:node-context-ref;
150             uses flow-types:flow;
151         }
152         output {
153             list aggregated-flow-statistics {
154                 uses stat-types:aggregate-flow-statistics;
155             }
156             uses tr:transaction-aware;
157         }
158     }
159
160     notification aggregate-flow-statistics-update {
161         status deprecated;
162
163         description "Aggregate flow statistics for a table, sent by switch";
164         uses inv:node;
165         uses stat-types:aggregate-flow-statistics;
166         uses tr:multipart-transaction-aware;
167     }
168 }