Merge "Fix modules Restconf call for mounted devices"
[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
47             container async-data-broker {
48                 uses config:service-ref {
49                     refine type {
50                         mandatory false;
51                         config:required-identity sal:dom-async-data-broker;
52                     }
53                 }
54             }
55
56             container root-schema-service {
57                 uses config:service-ref {
58                     refine type {
59                         mandatory false;
60                         config:required-identity sal:schema-service;
61                     }
62                 }
63             }
64         }
65     }
66
67     grouping dom-broker-config {
68         container schema-service {
69             uses config:service-ref {
70                 refine type {
71                     mandatory false;
72                     config:required-identity sal:schema-service;
73                 }
74             }
75         }
76
77         container config-data-store {
78              uses config:service-ref {
79                  refine type {
80                      mandatory false;
81                      config:required-identity config-dom-store-spi:config-dom-datastore;
82                  }
83              }
84         }
85
86         container operational-data-store {
87               uses config:service-ref {
88                    refine type {
89                        mandatory false;
90                        config:required-identity operational-dom-store-spi:operational-dom-datastore;
91                    }
92                }
93         }
94
95         leaf max-data-broker-future-callback-queue-size {
96             default 1000;
97             type uint16;
98             description "The maximum queue size for the data broker's commit future callback executor.";
99         }
100
101         leaf max-data-broker-future-callback-pool-size {
102             default 20;
103             type uint16;
104             description "The maximum thread pool size for the data broker's commit future callback executor.";
105         }
106
107         leaf max-data-broker-commit-queue-size {
108             default 5000;
109             type uint16;
110             description "The maximum queue size for the data broker's commit executor.";
111         }
112     }
113
114     grouping dom-broker-operational {
115         leaf total-commits {
116             type uint64;
117         }
118
119         leaf average-commit {
120             type uint64;
121             units ns;
122         }
123
124         leaf longest-commit-duration {
125             type uint64;
126             units ns;
127         }
128
129         leaf longest-commit-timestamp {
130             type yang:date-and-time;
131         }
132
133         leaf shortest-commit-duration {
134             type uint64;
135             units ns;
136         }
137
138         leaf shortest-commit-timestamp {
139             type yang:date-and-time;
140         }
141
142         rpcx:rpc-context-instance dom-broker-rpc-ctx;
143     }
144
145     identity dom-broker-rpc-ctx;
146
147     rpc reset-statistics {
148         description
149           "JMX call to clear the toasts-made counter.";
150
151         input {
152             uses rpcx:rpc-context-ref {
153                 refine context-instance {
154                     rpcx:rpc-context-instance dom-broker-rpc-ctx;
155                 }
156             }
157         }
158     }
159
160     augment "/config:modules/config:module/config:configuration" {
161         case dom-inmemory-data-broker {
162             when "/config:modules/config:module/config:type = 'dom-inmemory-data-broker'";
163
164             uses dom-broker-config;
165         }
166     }
167
168     augment "/config:modules/config:module/config:state" {
169         case dom-inmemory-data-broker {
170             when "/config:modules/config:module/config:type = 'dom-inmemory-data-broker'";
171
172             uses dom-broker-operational;
173         }
174     }
175
176     augment "/config:modules/config:module/config:state" {
177         case schema-service-singleton {
178             when "/config:modules/config:module/config:type = 'schema-service-singleton'";
179         }
180     }
181
182     augment "/config:modules/config:module/config:state" {
183         case dom-broker-impl {
184             when "/config:modules/config:module/config:type = 'dom-broker-impl'";
185             container data {
186                 uses common:data-state;
187             }
188         }
189     }
190 }