Expose AskTimeoutException counter from DatastoreInfoMXBean
[controller.git] / model / model-inventory / src / main / yang / opendaylight-inventory.yang
1 module opendaylight-inventory {
2     namespace "urn:opendaylight:inventory";
3     prefix inv;
4
5     import yang-ext { prefix ext; revision-date "2013-07-09"; }
6     import ietf-inet-types { prefix inet; revision-date "2013-07-15"; }
7
8     revision "2013-08-19" {
9         description "Initial revision of Inventory model";
10     }
11
12     typedef support-type {
13         type enumeration {
14             enum native;
15             enum emulated;
16             enum not-supported;
17         }
18     }
19
20     typedef node-id {
21         type inet:uri;
22         description "Identifier for a particular node. For example:
23
24                          myprotocol:<unique_node_id>
25
26                          myprotocol:12
27
28                      It is a good practice to always lead with a scoping
29                      identifier. In the example above the scoping was
30                      'myprotocol'. In your app you could use 'myapp' etc.";
31     }
32
33     typedef node-connector-id {
34         type inet:uri;
35         description "Identifier for a particular node-connector. For example:
36
37                          myprotocol:<unique_node_connector_id>
38                          myprotocol:3
39
40                      It is a good practice to always lead with a scoping
41                      identifier. In the example above the scoping was
42                      'myprotocol'. In your app you could use 'myapp' etc.";
43     }
44
45     // YANG does not have a statement which limits the scope of an
46     // instance-identifier to a particular subtree, which is why we are using
47     // a type capture and not an instance-identifier to define a node-ref and
48     // a node-connector-ref.
49     typedef node-ref {
50         type instance-identifier;
51         description "A reference that points to an
52                      opendaylight-light:nodes/node in the data tree.";
53     }
54
55     typedef node-connector-ref {
56         type instance-identifier;
57         description "A reference that points to an
58                      opendaylight-list:nodes/node/{node-id}/node-connector in
59                      the data tree.";
60     }
61
62     identity node-context {
63         description "A node-context is a classifier for node elements which
64                      allows an RPC to provide a service on behalf of a
65                      particular element in the data tree.";
66     }
67
68     identity node-connector-context {
69         description "A node-connector-context is a classifier for
70                      node-connector elements which allows an RPC to provide
71                      a service on behalf of a particular element in the data
72                      tree.";
73     }
74
75     // We are defining a base identity here because there are limitations with
76     // YANG enums. YANG does not allow you to extend enumeratations, therefore
77     // by defining a base identity we allow other yang files to extend this
78     // identity to define additional "enumerations". By using node-type as
79     // their base they are able to pass their object to fields that accept
80     // "node-types" while uniquely describing their type of node, such as
81     // "router-node" or "switch-node" etc.
82     // See https://wiki.opendaylight.org/view/YANG_Tools:YANG_to_Java_Mapping#Identity
83     // for more information.
84     identity node-type {
85         description "A base identity definition which represents a generic
86                      node type and can be extended in other yang files.";
87     }
88
89     identity node-connector-type {
90         description "A base identity definition which represents a generic
91                      node connector type and can be extended in other YANG
92                      files.";
93     }
94
95     grouping node {
96         description "Describes the contents of a generic node -
97                      essentially an ID and a list of node-connectors.
98                      Acts as an augmentation point where other YANG files
99                      can add additional information.";
100
101         leaf id {
102             type node-id;
103             description "The unique identifier for the node.";
104         }
105
106         list "node-connector" {
107             key "id";
108
109             description "A list of node connectors that belong this node.";
110             ext:context-instance "node-connector-context";
111
112             uses node-connector;
113         }
114     }
115
116     grouping node-connector {
117         description "Describes a generic node connector which consists of an ID.
118                      Acts as an augmentation point where other YANG files can
119                      add additional information.";
120
121         leaf id {
122             type node-connector-id;
123             description "The unique identifier for the node-connector.";
124         }
125     }
126
127     grouping node-context-ref {
128         description "A helper grouping which contains a reference to a node
129                      classified with a node-context. This allows RPCs in other
130                      YANG files to refine their input to a particular node
131                      instance.";
132
133         leaf node {
134             ext:context-reference "node-context";
135             type node-ref;
136             description "A reference to a particular node.";
137         }
138     }
139
140     // Base structure
141     container nodes {
142         description "The root container of all nodes.";
143
144         list node {
145             key "id";
146             ext:context-instance "node-context";
147             description "A list of nodes (as defined by the 'grouping node').";
148             uses node; //this refers to the 'grouping node' defined above.
149         }
150     }
151
152     // The following notifications should really be replaced by direct writes
153     // to the data tree with data change listeners listening to those changes.
154     // Notifications should be reserved for one time events which do not
155     // require persistence to the data tree.
156     notification node-updated {
157         status deprecated;
158
159         description "A notification sent by someone who realized there was
160                      a modification to a node, but did not modify the data
161                      tree.
162
163                      Describes that something on the node has been updated
164                      (including addition of a new node), but is for whatever
165                      reason is not modifying the data tree.
166
167                      Deprecated: If a process determines that a node was
168                      updated, then that logic should update the node using
169                      the DataBroker directly. Listeners interested update
170                      changes should register a data change listener for
171                      notifications on removals.";
172
173         leaf node-ref {
174             ext:context-reference "node-context";
175             description "A reference to the node which changed.";
176
177             type node-ref;
178         }
179         uses node;
180     }
181
182     notification node-connector-updated {
183         status deprecated;
184
185         description "A notification sent by someone who realized there was
186                      a modification to a node-connector, but did not modify
187                      the data tree.
188
189                      Describes that something on the node-connector has been
190                      updated (including addition of a new node-connector), but
191                      is for whatever reason is not modifying the data tree.
192
193                      Deprecated: If a process determines that a node-connector
194                      was updated, then that logic should update the
195                      node-connector using the DataBroker directly. Listeners
196                      interested update changes should register a data change
197                      listener for notifications on removals.";
198
199         leaf node-connector-ref {
200             ext:context-reference "node-connector-context";
201             type node-connector-ref;
202             description "A reference to the node-connector which changed.";
203         }
204         uses node-connector;
205     }
206
207     notification node-removed {
208         status deprecated;
209
210         description "A notification sent by someone who realized there was
211                      a node was removed, but did not modify the data tree.
212
213                      Describes that a node has been removed but is for whatever
214                      reason is not modifying the data tree.
215
216                      Deprecated: If a process determines that a node was
217                      removed, then that logic should remove the node from
218                      the DataBroker directly. Listeners interested in changes
219                      should register a data change listener for notifications
220                      on removals.";
221
222         leaf node-ref {
223             description "A reference to the node that was removed.";
224             ext:context-reference "node-context";
225             type node-ref;
226         }
227     }
228
229     notification node-connector-removed {
230         status deprecated;
231
232         description "A notification sent by someone who realized there was
233                      a node-connector was removed, but did not modify the data
234                      tree.
235
236                      Describes that a node-connector has been removed but is
237                      for whatever reason is not modifying the data tree.
238
239                      Deprecated: If a process determines that a node-connector
240                      was removed, then that logic should remove the
241                      node-connector from the DataBroker directly. Listeners
242                      interested in changes should register a data change
243                      listener for notifications on removals.";
244
245         leaf node-connector-ref {
246             description "A reference to the node-connector that was removed.";
247             ext:context-reference "node-connector-context";
248             type node-connector-ref;
249         }
250     }
251 }