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";}
9 revision "2013-08-19" {
10 description "Initial revision of Inventory model";
14 typedef support-type {
24 description "Identifier for a particular node. For example:
26 myprotocol:<unique_node_id>
30 It is a good practice to always lead with a scoping identifier.
31 In the example above the scoping was 'myprotocol'. In your app you
32 could use 'myapp' etc.";
35 typedef node-connector-id {
37 description "Identifier for a particular node-connector. For example:
39 myprotocol:<unique_node_connector_id>
42 It is a good practice to always lead with a scoping identifier.
43 In the example above the scoping was 'myprotocol'. In your app you
44 could use 'myapp' etc.";
48 //YANG does not have a statement which limits the scope of an instance-identifier to a particular subtree,
49 //which is why we are using a type capture and not an instance-identifier to define a node-ref and a node-connector-ref.
51 type instance-identifier;
52 description "A reference that points to an 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 opendaylight-list:nodes/node/{node-id}/node-connector in the data tree.";
60 identity node-context {
61 description "A node-context is a classifier for node elements which allows an RPC to provide a service on behalf of a particular element in the data tree.";
64 identity node-connector-context {
65 description "A node-connector-context is a classifier for node-connector elements which allows an RPC to provide a service on behalf of a particular element in the data tree.";
68 //We are defining a base identity here because there are limitations with yang enums. Yang doesn't allow you to extend enumeratations.
69 //Therefore by defining a base identity we allow other yang files to extend this identity to define additional "enumerations". By
70 //using node-type as their base they are able to pass their object to fields that accept "node-types" while uniquely describing their
71 //type of node, such as "router-node" or "switch-node" etc.
72 //See https://wiki.opendaylight.org/view/YANG_Tools:YANG_to_Java_Mapping#Identity for more information.
74 description "A base identity definition which represents a generic node type and can be extended in other yang files.";
77 identity node-connector-type {
78 description "A base identity definition which represents a generic node connector type and can be extended in other yang files.";
83 description "Describes the contents of a generic node -
84 essentially an ID and a list of node-connectors.
85 Acts as an augmentation point where other yang files
86 can add additional information.";
90 description "The unique identifier for the node.";
93 list "node-connector" {
96 description "A list of node connectors that belong this node.";
97 ext:context-instance "node-connector-context";
103 grouping node-connector {
105 description "Describes a generic node connector which consists of an ID.
106 Acts as an augmentation point where other yang files can
107 add additional information.";
110 type node-connector-id;
111 description "The unique identifier for the node-connector.";
115 grouping node-context-ref {
117 "A helper grouping which contains a reference to a node classified with a node-context. This allows RPCs in other yang files to refine their input to a particular node instance.";
120 ext:context-reference "node-context";
122 description "A reference to a particular node.";
126 /** Base structure **/
129 description "The root container of all nodes.";
133 ext:context-instance "node-context";
134 description "A list of nodes (as defined by the 'grouping node').";
135 uses node; //this refers to the 'grouping node' defined above.
139 //The following notifications should really be replaced by direct writes to the data tree with data change listeners listening to those changes.
140 //Notifications should be reserved for one time events which do not require persistence to the data tree.
141 notification node-updated {
145 description "A notification sent by someone who realized there was a modification to a node, but did not modify the data tree.
146 Describes that something on the node has been updated (including addition of a new node), but is for
147 whatever reason is not modifying the data tree.
149 Deprecated: If a process determines that a node was updated, then that
150 logic should update the node using the DataBroker directly. Listeners interested
151 update changes should register a data change listener for notifications on removals.";
154 ext:context-reference "node-context";
155 description "A reference to the node which changed.";
162 notification node-connector-updated {
166 description "A notification sent by someone who realized there was a modification to a node-connector, but did not modify the data tree.
167 Describes that something on the node-connector has been updated (including addition of a new node-connector), but is for
168 whatever reason is not modifying the data tree.
170 Deprecated: If a process determines that a node-connector was updated, then that
171 logic should update the node-connector using the DataBroker directly. Listeners interested
172 update changes should register a data change listener for notifications on removals.";
174 leaf node-connector-ref {
175 ext:context-reference "node-connector-context";
176 type node-connector-ref;
177 description "A reference to the node-connector which changed.";
182 notification node-removed {
186 description "A notification sent by someone who realized there was a node was removed, but did not modify the data tree.
187 Describes that a node has been removed but is for
188 whatever reason is not modifying the data tree.
190 Deprecated: If a process determines that a node was removed, then that
191 logic should remove the node from the DataBroker directly. Listeners interested
192 in changes should register a data change listener for notifications on removals.";
195 description "A reference to the node that was removed.";
196 ext:context-reference "node-context";
201 notification node-connector-removed {
205 description "A notification sent by someone who realized there was a node-connector was removed, but did not modify the data tree.
206 Describes that a node-connector has been removed but is for
207 whatever reason is not modifying the data tree.
209 Deprecated: If a process determines that a node-connector was removed, then that
210 logic should remove the node-connector from the DataBroker directly. Listeners interested
211 in changes should register a data change listener for notifications on removals.";
213 leaf node-connector-ref {
214 description "A reference to the node-connector that was removed.";
215 ext:context-reference "node-connector-context";
216 type node-connector-ref;