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 {
26 description "Identifier for a particular node. For example:
28 myprotocol:<unique_node_id>
32 It is a good practice to always lead with a scoping identifier.
33 In the example above the scoping was 'myprotocol'. In your app you
34 could use 'myapp' etc.";
37 typedef node-connector-id {
40 description "Identifier for a particular node-connector. For example:
42 myprotocol:<unique_node_connector_id>
45 It is a good practice to always lead with a scoping identifier.
46 In the example above the scoping was 'myprotocol'. In your app you
47 could use 'myapp' etc.";
51 //YANG does not have a statement which limits the scope of an instance-identifier to a particular subtree,
52 //which is why we are using a type capture and not an instance-identifier to define a node-ref and a node-connector-ref.
55 type instance-identifier;
56 description "A reference that points to an opendaylight-light:nodes/node in the data tree.";
59 typedef node-connector-ref {
61 type instance-identifier;
62 description "A reference that points to an opendaylight-list:nodes/node/{node-id}/node-connector in the data tree.";
65 identity node-context {
67 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.";
70 identity node-connector-context {
72 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.";
75 //We are defining a base identity here because there are limitations with yang enums. Yang doesn't allow you to extend enumeratations.
76 //Therefore by defining a base identity we allow other yang files to extend this identity to define additional "enumerations". By
77 //using node-type as their base they are able to pass their object to fields that accept "node-types" while uniquely describing their
78 //type of node, such as "router-node" or "switch-node" etc.
79 //See https://wiki.opendaylight.org/view/YANG_Tools:YANG_to_Java_Mapping#Identity for more information.
82 description "A base identity definition which represents a generic node type and can be extended in other yang files.";
85 identity node-connector-type {
87 description "A base identity definition which represents a generic node connector type and can be extended in other yang files.";
92 description "Describes the contents of a generic node -
93 essentially an ID and a list of node-connectors.
94 Acts as an augmentation point where other yang files
95 can add additional information.";
99 description "The unique identifier for the node.";
102 list "node-connector" {
105 description "A list of node connectors that belong this node.";
106 ext:context-instance "node-connector-context";
112 grouping node-connector {
114 description "Describes a generic node connector which consists of an ID.
115 Acts as an augmentation point where other yang files can
116 add additional information.";
119 type node-connector-id;
120 description "The unique identifier for the node-connector.";
124 grouping node-context-ref {
127 "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.";
130 ext:context-reference "node-context";
132 description "A reference to a particular node.";
136 /** Base structure **/
139 description "The root container of all nodes.";
143 ext:context-instance "node-context";
144 description "A list of nodes (as defined by the 'grouping node').";
145 uses node; //this refers to the 'grouping node' defined above.
149 //The following notifications should really be replaced by direct writes to the data tree with data change listeners listening to those changes.
150 //Notifications should be reserved for one time events which do not require persistence to the data tree.
151 notification node-updated {
154 description "A notification sent by someone who realized there was a modification to a node, but did not modify the data tree.
155 Describes that something on the node has been updated (including addition of a new node), but is for
156 whatever reason is not modifying the data tree.
158 Deprecated: If a process determines that a node was updated, then that
159 logic should update the node using the DataBroker directly. Listeners interested
160 update changes should register a data change listener for notifications on removals.";
163 ext:context-reference "node-context";
164 description "A reference to the node which changed.";
171 notification node-connector-updated {
175 description "A notification sent by someone who realized there was a modification to a node-connector, but did not modify the data tree.
176 Describes that something on the node-connector has been updated (including addition of a new node-connector), but is for
177 whatever reason is not modifying the data tree.
179 Deprecated: If a process determines that a node-connector was updated, then that
180 logic should update the node-connector using the DataBroker directly. Listeners interested
181 update changes should register a data change listener for notifications on removals.";
183 leaf node-connector-ref {
184 ext:context-reference "node-connector-context";
185 type node-connector-ref;
186 description "A reference to the node-connector which changed.";
191 notification node-removed {
195 description "A notification sent by someone who realized there was a node was removed, but did not modify the data tree.
196 Describes that a node has been removed but is for
197 whatever reason is not modifying the data tree.
199 Deprecated: If a process determines that a node was removed, then that
200 logic should remove the node from the DataBroker directly. Listeners interested
201 in changes should register a data change listener for notifications on removals.";
204 description "A reference to the node that was removed.";
205 ext:context-reference "node-context";
210 notification node-connector-removed {
214 description "A notification sent by someone who realized there was a node-connector was removed, but did not modify the data tree.
215 Describes that a node-connector has been removed but is for
216 whatever reason is not modifying the data tree.
218 Deprecated: If a process determines that a node-connector was removed, then that
219 logic should remove the node-connector from the DataBroker directly. Listeners interested
220 in changes should register a data change listener for notifications on removals.";
222 leaf node-connector-ref {
223 description "A reference to the node-connector that was removed.";
224 ext:context-reference "node-connector-context";
225 type node-connector-ref;