Merge "BUG-4117: add support for meter and group old Notif"
[openflowplugin.git] / model / model-flow-statistics / src / main / yang / opendaylight-direct-statistics.yang
1 module opendaylight-direct-statistics {
2     namespace "urn:opendaylight:direct:statistics";
3     prefix directstat;
4
5     import yang-ext { prefix ext; revision-date "2013-07-09"; }
6     import ietf-inet-types { prefix inet; revision-date "2010-09-24"; }
7     import opendaylight-inventory { prefix inv; revision-date "2013-08-19"; }
8     import opendaylight-statistics-types { prefix stat-types; revision-date "2013-09-25"; }
9
10     import opendaylight-flow-types  { prefix flow-types;  revision-date "2013-10-26"; }
11     import opendaylight-group-types { prefix group-types; revision-date "2013-10-18"; }
12     import opendaylight-meter-types { prefix meter-types; revision-date "2013-09-18"; }
13     import opendaylight-queue-types { prefix queue-types; revision-date "2013-09-25"; }
14     import opendaylight-table-types { prefix table-types; revision-date "2013-10-26"; }
15
16     import opendaylight-flow-statistics { prefix flowstat; revision-date "2013-08-19"; }
17     import opendaylight-port-statistics { prefix portstat; revision-date "2013-12-14"; }
18     import opendaylight-queue-statistics { prefix queuestat; revision-date "2013-12-16"; }
19
20     description "Openflow direct statistics polling.";
21
22     revision "2016-05-11" {
23         description "Initial revision of direct statistics service";
24     }
25
26     grouping store-stats-grouping {
27         description "Store collected statistics to DS/operational";
28
29         leaf store-stats {
30             type boolean;
31             default false;
32         }
33     }
34
35     grouping stats-input-common-grouping {
36         description "Shared input parameters for all rpc statistics (routing context and datastore flag)";
37
38         uses inv:node-context-ref;
39         uses store-stats-grouping;
40     }
41
42     rpc get-flow-statistics {
43         description "Get statistics for given flow";
44
45         input {
46             uses stats-input-common-grouping;
47             uses flow-types:flow;
48         }
49
50         output {
51             uses flowstat:flow-and-statistics-map-list;
52         }
53     }
54
55     rpc get-group-statistics {
56         description "Get statistics for given group";
57
58         input {
59             uses stats-input-common-grouping;
60
61             leaf group-id {
62                 type group-types:group-id;
63             }
64         }
65
66         output {
67             uses group-types:group-statistics-reply;
68         }
69     }
70
71     rpc get-meter-statistics {
72         description "Get statistics for given meter";
73
74         input {
75             uses stats-input-common-grouping;
76
77             leaf meter-id {
78                 type meter-types:meter-id;
79             }
80         }
81
82         output {
83             uses meter-types:meter-statistics-reply;
84         }
85     }
86
87     rpc get-node-connector-statistics {
88         description "Get statistics for given node connector from the node";
89
90         input {
91             uses stats-input-common-grouping;
92
93             leaf node-connector-id {
94                 description "Optional, if omitted, returns statistics for all ports";
95                 type inv:node-connector-id;
96             }
97         }
98
99         output {
100             uses portstat:node-connector-statistics-and-port-number-map;
101         }
102     }
103
104     rpc get-queue-statistics {
105         description "Get statistics for given queues from given port of the node";
106
107         input {
108             uses stats-input-common-grouping;
109
110             leaf node-connector-id {
111                 type inv:node-connector-id;
112             }
113
114             leaf queue-id {
115                 type queue-types:queue-id;
116             }
117         }
118
119         output {
120             uses queuestat:queue-id-and-statistics-map;
121         }
122     }
123 }