1 module opendaylight-inventory {
2 namespace "urn:opendaylight:inventory";
5 import yang-ext { prefix ext; revision-date "2013-07-09"; }
6 import ietf-inet-types { prefix inet; revision-date "2013-07-15"; }
8 revision "2013-08-19" {
9 description "Initial revision of Inventory model";
12 typedef support-type {
22 description "Identifier for a particular node. For example:
24 myprotocol:<unique_node_id>
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.";
33 typedef node-connector-id {
35 description "Identifier for a particular node-connector. For example:
37 myprotocol:<unique_node_connector_id>
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.";
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.
50 type instance-identifier;
51 description "A reference that points to an
52 opendaylight-light:nodes/node in the data tree.";
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
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.";
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
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.
85 description "A base identity definition which represents a generic
86 node type and can be extended in other yang files.";
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
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.";
103 description "The unique identifier for the node.";
106 list "node-connector" {
109 description "A list of node connectors that belong this node.";
110 ext:context-instance "node-connector-context";
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.";
122 type node-connector-id;
123 description "The unique identifier for the node-connector.";
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
134 ext:context-reference "node-context";
136 description "A reference to a particular node.";
142 description "The root container of all nodes.";
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.
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 {
159 description "A notification sent by someone who realized there was
160 a modification to a node, but did not modify the data
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.
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.";
174 ext:context-reference "node-context";
175 description "A reference to the node which changed.";
182 notification node-connector-updated {
185 description "A notification sent by someone who realized there was
186 a modification to a node-connector, but did not modify
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.
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.";
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.";
207 notification node-removed {
210 description "A notification sent by someone who realized there was
211 a node was removed, but did not modify the data tree.
213 Describes that a node has been removed but is for whatever
214 reason is not modifying the data tree.
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
223 description "A reference to the node that was removed.";
224 ext:context-reference "node-context";
229 notification node-connector-removed {
232 description "A notification sent by someone who realized there was
233 a node-connector was removed, but did not modify the data
236 Describes that a node-connector has been removed but is
237 for whatever reason is not modifying the data tree.
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.";
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;