Model dom-broker statistics
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / yang / opendaylight-dom-broker-impl.yang
1 module opendaylight-sal-dom-broker-impl {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl";
4     prefix "broker";
5
6     import config { prefix config; revision-date 2013-04-05; }
7     import ietf-yang-types { prefix yang; }
8     import opendaylight-md-sal-dom {prefix sal;}
9     import opendaylight-md-sal-common {prefix common;}
10     import opendaylight-config-dom-datastore {prefix config-dom-store-spi;}
11     import opendaylight-operational-dom-datastore {prefix operational-dom-store-spi;}
12     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
13
14     description
15         "Service definition for Binding Aware MD-SAL.
16         Note: The dom-inmemory-data-broker utilizes configurable config-dom-datastore
17         and operation-dom-datastore. If configuration is not done for this stores
18         then it defaults to InMemoryDOMDataStore";
19
20     revision "2013-10-28" {
21         description
22             "Initial revision";
23     }
24
25     identity dom-broker-impl {
26         base config:module-type;
27         config:provided-service sal:dom-broker-osgi-registry;
28         config:java-name-prefix DomBrokerImpl;
29     }
30
31
32     identity dom-inmemory-data-broker {
33         base config:module-type;
34         config:provided-service sal:dom-async-data-broker;
35     }
36
37     identity schema-service-singleton {
38         base config:module-type;
39         config:provided-service sal:schema-service;
40         config:java-name-prefix SchemaServiceImplSingleton;
41     }
42
43     augment "/config:modules/config:module/config:configuration" {
44         case dom-broker-impl {
45             when "/config:modules/config:module/config:type = 'dom-broker-impl'";
46             container data-store {
47                 uses config:service-ref {
48                     refine type {
49                         mandatory false;
50                         config:required-identity sal:dom-data-store;
51                     }
52                 }
53             }
54
55             container async-data-broker {
56                 uses config:service-ref {
57                     refine type {
58                         mandatory false;
59                         config:required-identity sal:dom-async-data-broker;
60                     }
61                 }
62             }
63
64             container root-schema-service {
65                 uses config:service-ref {
66                     refine type {
67                         mandatory false;
68                         config:required-identity sal:schema-service;
69                     }
70                 }
71             }
72         }
73     }
74
75     grouping dom-broker-config {
76         container schema-service {
77             uses config:service-ref {
78                 refine type {
79                     mandatory false;
80                     config:required-identity sal:schema-service;
81                 }
82             }
83         }
84
85         container config-data-store {
86              uses config:service-ref {
87                  refine type {
88                      mandatory false;
89                      config:required-identity config-dom-store-spi:config-dom-datastore;
90                  }
91              }
92         }
93
94         container operational-data-store {
95               uses config:service-ref {
96                    refine type {
97                        mandatory false;
98                        config:required-identity operational-dom-store-spi:operational-dom-datastore;
99                    }
100                }
101         }
102
103         leaf max-data-broker-future-callback-queue-size {
104             default 1000;
105             type uint16;
106             description "The maximum queue size for the data broker's commit future callback executor.";
107         }
108
109         leaf max-data-broker-future-callback-pool-size {
110             default 20;
111             type uint16;
112             description "The maximum thread pool size for the data broker's commit future callback executor.";
113         }
114
115         leaf max-data-broker-commit-queue-size {
116             default 5000;
117             type uint16;
118             description "The maximum queue size for the data broker's commit executor.";
119         }
120     }
121
122     grouping dom-broker-operational {
123         leaf total-commits {
124             type uint64;
125         }
126
127         leaf average-commit {
128             type uint64;
129             units ns;
130         }
131
132         leaf longest-commit-duration {
133             type uint64;
134             units ns;
135         }
136
137         leaf longest-commit-timestamp {
138             type yang:date-and-time;
139         }
140
141         leaf shortest-commit-duration {
142             type uint64;
143             units ns;
144         }
145
146         leaf shortest-commit-timestamp {
147             type yang:date-and-time;
148         }
149
150         rpcx:rpc-context-instance dom-broker-rpc-ctx;
151     }
152
153     identity dom-broker-rpc-ctx;
154
155     rpc reset-statistics {
156         description
157           "JMX call to clear the toasts-made counter.";
158
159         input {
160             uses rpcx:rpc-context-ref {
161                 refine context-instance {
162                     rpcx:rpc-context-instance dom-broker-rpc-ctx;
163                 }
164             }
165         }
166     }
167
168     augment "/config:modules/config:module/config:configuration" {
169         case dom-inmemory-data-broker {
170             when "/config:modules/config:module/config:type = 'dom-inmemory-data-broker'";
171
172             uses dom-broker-config;
173         }
174     }
175
176     augment "/config:modules/config:module/config:state" {
177         case dom-inmemory-data-broker {
178             when "/config:modules/config:module/config:type = 'dom-inmemory-data-broker'";
179
180             uses dom-broker-operational;
181         }
182     }
183
184     augment "/config:modules/config:module/config:state" {
185         case schema-service-singleton {
186             when "/config:modules/config:module/config:type = 'schema-service-singleton'";
187         }
188     }
189
190     augment "/config:modules/config:module/config:state" {
191         case dom-broker-impl {
192             when "/config:modules/config:module/config:type = 'dom-broker-impl'";
193             container data {
194                 uses common:data-state;
195             }
196         }
197     }
198 }