Clean up opendaylight-inventory model 10/84210/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 5 Sep 2019 06:52:10 +0000 (08:52 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 5 Sep 2019 08:59:34 +0000 (08:59 +0000)
This is just a formatting change, cleaning up descriptions and
comments.

Change-Id: I2757280371851e2586221b01de143e8b987ed1ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/model/model-inventory/src/main/yang/opendaylight-inventory.yang

index d61a4c0f7755525b53544b4e5a654da8da983d63..f58fcc48fe0f97003b792a566201a520d34c4c34 100644 (file)
@@ -2,15 +2,13 @@ module opendaylight-inventory {
     namespace "urn:opendaylight:inventory";
     prefix inv;
 
     namespace "urn:opendaylight:inventory";
     prefix inv;
 
-    import yang-ext {prefix ext; revision-date "2013-07-09";}
-    import ietf-inet-types {prefix inet; revision-date "2013-07-15";}
-
+    import yang-ext { prefix ext; revision-date "2013-07-09"; }
+    import ietf-inet-types { prefix inet; revision-date "2013-07-15"; }
 
     revision "2013-08-19" {
         description "Initial revision of Inventory model";
     }
 
 
     revision "2013-08-19" {
         description "Initial revision of Inventory model";
     }
 
-
     typedef support-type {
         type enumeration {
             enum native;
     typedef support-type {
         type enumeration {
             enum native;
@@ -23,67 +21,82 @@ module opendaylight-inventory {
         type inet:uri;
         description "Identifier for a particular node. For example:
 
         type inet:uri;
         description "Identifier for a particular node. For example:
 
-                        myprotocol:<unique_node_id>
+                         myprotocol:<unique_node_id>
 
 
-                        myprotocol:12
+                         myprotocol:12
 
 
-                    It is a good practice to always lead with a scoping identifier.
-                    In the example above the scoping was 'myprotocol'. In your app you
-                    could use 'myapp' etc.";
+                     It is a good practice to always lead with a scoping
+                     identifier. In the example above the scoping was
+                     'myprotocol'. In your app you could use 'myapp' etc.";
     }
 
     typedef node-connector-id {
         type inet:uri;
         description "Identifier for a particular node-connector. For example:
 
     }
 
     typedef node-connector-id {
         type inet:uri;
         description "Identifier for a particular node-connector. For example:
 
-                        myprotocol:<unique_node_connector_id>
-                        myprotocol:3
-
-                    It is a good practice to always lead with a scoping identifier.
-                    In the example above the scoping was 'myprotocol'. In your app you
-                    could use 'myapp' etc.";
+                         myprotocol:<unique_node_connector_id>
+                         myprotocol:3
 
 
+                     It is a good practice to always lead with a scoping
+                     identifier. In the example above the scoping was
+                     'myprotocol'. In your app you could use 'myapp' etc.";
     }
 
     }
 
-    //YANG does not have a statement which limits the scope of an instance-identifier to a particular subtree,
-    //which is why we are using a type capture and not an instance-identifier to define a node-ref and a node-connector-ref.
+    // YANG does not have a statement which limits the scope of an
+    // instance-identifier to a particular subtree, which is why we are using
+    // a type capture and not an instance-identifier to define a node-ref and
+    // a node-connector-ref.
     typedef node-ref {
         type instance-identifier;
     typedef node-ref {
         type instance-identifier;
-        description "A reference that points to an opendaylight-light:nodes/node in the data tree.";
+        description "A reference that points to an
+                     opendaylight-light:nodes/node in the data tree.";
     }
 
     typedef node-connector-ref {
         type instance-identifier;
     }
 
     typedef node-connector-ref {
         type instance-identifier;
-        description "A reference that points to an opendaylight-list:nodes/node/{node-id}/node-connector in the data tree.";
+        description "A reference that points to an
+                     opendaylight-list:nodes/node/{node-id}/node-connector in
+                     the data tree.";
     }
 
     identity node-context {
     }
 
     identity node-context {
-        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.";
+        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.";
     }
 
     identity node-connector-context {
     }
 
     identity node-connector-context {
-        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.";
-    }
-
-    //We are defining a base identity here because there are limitations with yang enums. Yang doesn't allow you to extend enumeratations.
-    //Therefore by defining a base identity we allow other yang files to extend this identity to define additional "enumerations". By
-    //using node-type as their base they are able to pass their object to fields that accept "node-types" while uniquely describing their
-    //type of node, such as "router-node" or "switch-node" etc.
-    //See https://wiki.opendaylight.org/view/YANG_Tools:YANG_to_Java_Mapping#Identity for more information.
+        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.";
+    }
+
+    // We are defining a base identity here because there are limitations with
+    // YANG enums. YANG does not allow you to extend enumeratations, therefore
+    // by defining a base identity we allow other yang files to extend this
+    // identity to define additional "enumerations". By using node-type as
+    // their base they are able to pass their object to fields that accept
+    // "node-types" while uniquely describing their type of node, such as
+    // "router-node" or "switch-node" etc.
+    // See https://wiki.opendaylight.org/view/YANG_Tools:YANG_to_Java_Mapping#Identity
+    // for more information.
     identity node-type {
     identity node-type {
-        description "A base identity definition which represents a generic node type and can be extended in other yang files.";
+        description "A base identity definition which represents a generic
+                     node type and can be extended in other yang files.";
     }
 
     identity node-connector-type {
     }
 
     identity node-connector-type {
-        description "A base identity definition which represents a generic node connector type and can be extended in other yang files.";
+        description "A base identity definition which represents a generic
+                     node connector type and can be extended in other YANG
+                     files.";
     }
 
     grouping node {
     }
 
     grouping node {
-
         description "Describes the contents of a generic node -
                      essentially an ID and a list of node-connectors.
         description "Describes the contents of a generic node -
                      essentially an ID and a list of node-connectors.
-                     Acts as an augmentation point where other yang files
-                      can add additional information.";
+                     Acts as an augmentation point where other YANG files
+                     can add additional information.";
 
         leaf id {
             type node-id;
 
         leaf id {
             type node-id;
@@ -101,10 +114,9 @@ module opendaylight-inventory {
     }
 
     grouping node-connector {
     }
 
     grouping node-connector {
-
         description "Describes a generic node connector which consists of an ID.
         description "Describes a generic node connector which consists of an ID.
-                     Acts as an augmentation point where other yang files can
-                      add additional information.";
+                     Acts as an augmentation point where other YANG files can
+                     add additional information.";
 
         leaf id {
             type node-connector-id;
 
         leaf id {
             type node-connector-id;
@@ -113,8 +125,10 @@ module opendaylight-inventory {
     }
 
     grouping node-context-ref {
     }
 
     grouping node-context-ref {
-        description
-        "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.";
+        description "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.";
 
         leaf node {
             ext:context-reference "node-context";
 
         leaf node {
             ext:context-reference "node-context";
@@ -123,9 +137,8 @@ module opendaylight-inventory {
         }
     }
 
         }
     }
 
-    /** Base structure **/
+    // Base structure
     container nodes {
     container nodes {
-
         description "The root container of all nodes.";
 
         list node {
         description "The root container of all nodes.";
 
         list node {
@@ -136,19 +149,26 @@ module opendaylight-inventory {
         }
     }
 
         }
     }
 
-    //The following notifications should really be replaced by direct writes to the data tree with data change listeners listening to those changes.
-    //Notifications should be reserved for one time events which do not require persistence to the data tree.
+    // The following notifications should really be replaced by direct writes
+    // to the data tree with data change listeners listening to those changes.
+    // Notifications should be reserved for one time events which do not
+    // require persistence to the data tree.
     notification node-updated {
     notification node-updated {
-
         status deprecated;
 
         status deprecated;
 
-        description "A notification sent by someone who realized there was a modification to a node, but did not modify the data tree.
-                    Describes that something on the node has been updated (including addition of a new node), but is for
-                    whatever reason is not modifying the data tree.
+        description "A notification sent by someone who realized there was
+                     a modification to a node, but did not modify the data
+                     tree.
+
+                     Describes that something on the node has been updated
+                     (including addition of a new node), but is for whatever
+                     reason is not modifying the data tree.
 
 
-                    Deprecated: If a process determines that a node was updated, then that
-                    logic should update the node using the DataBroker directly. Listeners interested
-                    update changes should register a data change listener for notifications on removals.";
+                     Deprecated: If a process determines that a node was
+                     updated, then that logic should update the node using
+                     the DataBroker directly. Listeners interested update
+                     changes should register a data change listener for
+                     notifications on removals.";
 
         leaf node-ref {
             ext:context-reference "node-context";
 
         leaf node-ref {
             ext:context-reference "node-context";
@@ -160,16 +180,21 @@ module opendaylight-inventory {
     }
 
     notification node-connector-updated {
     }
 
     notification node-connector-updated {
-
         status deprecated;
 
         status deprecated;
 
-        description "A notification sent by someone who realized there was a modification to a node-connector, but did not modify the data tree.
-                    Describes that something on the node-connector has been updated (including addition of a new node-connector), but is for
-                    whatever reason is not modifying the data tree.
+        description "A notification sent by someone who realized there was
+                     a modification to a node-connector, but did not modify
+                     the data tree.
+
+                     Describes that something on the node-connector has been
+                     updated (including addition of a new node-connector), but
+                     is for whatever reason is not modifying the data tree.
 
 
-                    Deprecated: If a process determines that a node-connector was updated, then that
-                    logic should update the node-connector using the DataBroker directly. Listeners interested
-                    update changes should register a data change listener for notifications on removals.";
+                     Deprecated: If a process determines that a node-connector
+                     was updated, then that logic should update the
+                     node-connector using the DataBroker directly. Listeners
+                     interested update changes should register a data change
+                     listener for notifications on removals.";
 
         leaf node-connector-ref {
             ext:context-reference "node-connector-context";
 
         leaf node-connector-ref {
             ext:context-reference "node-connector-context";
@@ -180,16 +205,19 @@ module opendaylight-inventory {
     }
 
     notification node-removed {
     }
 
     notification node-removed {
-
         status deprecated;
 
         status deprecated;
 
-        description "A notification sent by someone who realized there was a node was removed, but did not modify the data tree.
-                    Describes that a node has been removed but is for
-                    whatever reason is not modifying the data tree.
+        description "A notification sent by someone who realized there was
+                     a node was removed, but did not modify the data tree.
+
+                     Describes that a node has been removed but is for whatever
+                     reason is not modifying the data tree.
 
 
-                    Deprecated: If a process determines that a node was removed, then that
-                    logic should remove the node from the DataBroker directly. Listeners interested
-                    in changes should register a data change listener for notifications on removals.";
+                     Deprecated: If a process determines that a node was
+                     removed, then that logic should remove the node from
+                     the DataBroker directly. Listeners interested in changes
+                     should register a data change listener for notifications
+                     on removals.";
 
         leaf node-ref {
             description "A reference to the node that was removed.";
 
         leaf node-ref {
             description "A reference to the node that was removed.";
@@ -199,16 +227,20 @@ module opendaylight-inventory {
     }
 
     notification node-connector-removed {
     }
 
     notification node-connector-removed {
-
         status deprecated;
 
         status deprecated;
 
-        description "A notification sent by someone who realized there was a node-connector was removed, but did not modify the data tree.
-                    Describes that a node-connector has been removed but is for
-                    whatever reason is not modifying the data tree.
+        description "A notification sent by someone who realized there was
+                     a node-connector was removed, but did not modify the data
+                     tree.
+
+                     Describes that a node-connector has been removed but is
+                     for whatever reason is not modifying the data tree.
 
 
-                    Deprecated: If a process determines that a node-connector was removed, then that
-                    logic should remove the node-connector from the DataBroker directly. Listeners interested
-                    in changes should register a data change listener for notifications on removals.";
+                     Deprecated: If a process determines that a node-connector
+                     was removed, then that logic should remove the
+                     node-connector from the DataBroker directly. Listeners
+                     interested in changes should register a data change
+                     listener for notifications on removals.";
 
         leaf node-connector-ref {
             description "A reference to the node-connector that was removed.";
 
         leaf node-connector-ref {
             description "A reference to the node-connector that was removed.";