Sync Common folder
[transportpce.git] / ordmodels / network / src / main / yang / ietf-network-topology@2015-06-08.yang
index e262d8799b352991f354fed49baffa377f3cd494..635496c066c3f062f2f1b5dfbfae30a2e6196c8b 100644 (file)
-module ietf-network-topology {\r
-  yang-version 1;\r
-  namespace "urn:ietf:params:xml:ns:yang:ietf-network-topology";\r
-  prefix lnk;\r
-\r
-  import ietf-inet-types {\r
-    prefix inet;\r
-  }\r
-  import ietf-network {\r
-    prefix nd;\r
-  }\r
-\r
-  organization "TBD";\r
-  contact\r
-    "WILL-BE-DEFINED-LATER";\r
-  description\r
-    "This module defines a common base model for network topology, \r
-     augmenting the base network model with links to connect nodes, \r
-     as well as termination points to terminate links on nodes.";\r
-\r
-  revision 2015-06-08 {\r
-    description\r
-      "Initial revision.";\r
-    reference "draft-ietf-i2rs-yang-network-topo-01";\r
-  }\r
-\r
-  typedef link-id {\r
-    type inet:uri;\r
-    description\r
-      "An identifier for a link in a topology.\r
-       The identifier may be opaque.\r
-       The identifier SHOULD be chosen such that the same link in a\r
-       real network topology will always be identified through the\r
-       same identifier, even if the model is instantiated in \r
-          separate datastores. An implementation MAY choose to capture\r
-       semantics in the identifier, for example to indicate the type\r
-       of link and/or the type of topology that the link is a part \r
-       of.";\r
-  }\r
-\r
-  typedef tp-id {\r
-    type inet:uri;\r
-    description\r
-      "An identifier for termination points on a node.\r
-       The identifier may be opaque.\r
-       The identifier SHOULD be chosen such that the same TP in a\r
-       real network topology will always be identified through the\r
-       same identifier, even if the model is instantiated in\r
-       separate datastores. An implementation MAY choose to capture\r
-       semantics in the identifier, for example to indicate the type\r
-       of TP and/or the type of node and topology that the TP is a \r
-       part of.";\r
-  }\r
-\r
-  grouping link-ref {\r
-    description\r
-      "References a link in a specific network.";\r
-    leaf link-ref {\r
-      type leafref {\r
-        path "/nd:network[nd:network-id=current()/../"+\r
-          "nd:network-ref]/link/link-id";\r
-      }\r
-      description\r
-        "A type for an absolute reference a link instance.\r
-         (This type should not be used for relative references.\r
-         In such a case, a relative path should be used instead.)";\r
-    }\r
-    uses nd:network-ref;\r
-  }\r
-\r
-  grouping tp-ref {\r
-    description\r
-      "References a termination point in a specific node.";\r
-    leaf tp-ref {\r
-      type leafref {\r
-        path "/nd:network[nd:network-id=current()/../"+\r
-          "nd:network-ref]/nd:node[nd:node-id=current()/../"+\r
-          "nd:node-ref]/termination-point/tp-id";\r
-      }\r
-      description\r
-        "A type for an absolute reference to a termination point.\r
-         (This type should not be used for relative references.\r
-         In such a case, a relative path should be used instead.)";\r
-    }\r
-    uses nd:node-ref;\r
-  }\r
-\r
-  augment "/nd:network" {\r
-    description \r
-      "Add links to the network model.";\r
-    list link {\r
-      key "link-id";\r
-      description\r
-        "A Network Link connects a by Local (Source) node and\r
-         a Remote (Destination) Network Nodes via a set of the\r
-         nodes' termination points.\r
-         As it is possible to have several links between the same\r
-         source and destination nodes, and as a link could\r
-         potentially be re-homed between termination points, to\r
-         ensure that we would always know to distinguish between\r
-         links, every link is identified by a dedicated link\r
-         identifier.\r
-         Note that a link models a point-to-point link, not a\r
-         multipoint link.\r
-         Layering dependencies on links in underlay topologies are\r
-         not represented as the layering information of nodes and of\r
-         termination points is sufficient.";\r
-      container source {\r
-        description\r
-          "This container holds the logical source of a particular\r
-           link.";\r
-        leaf source-node {\r
-          type leafref {\r
-            path "../../../nd:node/nd:node-id";\r
-          }\r
-          mandatory true;\r
-          description\r
-            "Source node identifier, must be in same topology.";\r
-        }\r
-        leaf source-tp {\r
-          type leafref {\r
-            path "../../../nd:node[nd:node-id=current()/../"+\r
-              "source-node]/termination-point/tp-id";\r
-          }\r
-          description\r
-            "Termination point within source node that terminates\r
-             the link.";\r
-        }\r
-      }\r
-      container destination {\r
-        description\r
-          "This container holds the logical destination of a\r
-           particular link.";\r
-        leaf dest-node {\r
-          type leafref {\r
-            path "../../../nd:node/nd:node-id";\r
-          }\r
-          mandatory true;\r
-          description\r
-            "Destination node identifier, must be in the same\r
-             network.";\r
-        }\r
-        leaf dest-tp {\r
-          type leafref {\r
-            path "../../../nd:node[nd:node-id=current()/../"+\r
-              "dest-node]/termination-point/tp-id";\r
-          }\r
-          description\r
-            "Termination point within destination node that\r
-             terminates the link.";\r
-        }\r
-      }\r
-      leaf link-id {\r
-        type link-id;\r
-        description\r
-          "The identifier of a link in the topology.\r
-           A link is specific to a topology to which it belongs.";\r
-      }\r
-      list supporting-link {\r
-        key "network-ref link-ref";\r
-        description\r
-          "Identifies the link, or links, that this link\r
-           is dependent on.";\r
-        leaf network-ref {\r
-          type leafref {\r
-            path "../../../nd:supporting-network/nd:network-ref";\r
-          }\r
-          description\r
-            "This leaf identifies in which underlay topology\r
-             supporting link is present.";\r
-        }\r
-        leaf link-ref {\r
-          type leafref {\r
-            path "/nd:network[nd:network-id=current()/.."+\r
-              "/network-ref]/link/link-id";\r
-          }\r
-          description\r
-            "This leaf identifies a link which is a part\r
-             of this link's underlay. Reference loops, in which\r
-             a link identifies itself as its underlay, either\r
-             directly or transitively, are not allowed.";\r
-        }\r
-      }\r
-    }\r
-  }\r
-  augment "/nd:network/nd:node" {\r
-    description\r
-      "Augment termination points which terminate links.  \r
-       Termination points can ultimately be mapped to interfaces.";\r
-    list termination-point {\r
-      key "tp-id";\r
-      description\r
-        "A termination point can terminate a link.\r
-         Depending on the type of topology, a termination point\r
-         could, for example, refer to a port or an interface.";\r
-      leaf tp-id {\r
-        type tp-id;\r
-        description\r
-          "Termination point identifier.";\r
-      }\r
-      list supporting-termination-point {\r
-        key "network-ref node-ref tp-ref";\r
-        description\r
-          "The leaf list identifies any termination points that\r
-           the termination point is dependent on, or maps onto.\r
-           Those termination points will themselves be contained\r
-           in a supporting node.\r
-           This dependency information can be inferred from\r
-           the dependencies between links.  For this reason,\r
-           this item is not separately configurable.  Hence no\r
-           corresponding constraint needs to be articulated.\r
-           The corresponding information is simply provided by the\r
-           implementing system.";\r
-        leaf network-ref {\r
-          type leafref {\r
-            path "../../../nd:supporting-node/nd:network-ref";\r
-          }\r
-          description\r
-            "This leaf identifies in which topology the\r
-             supporting termination point is present.";\r
-        }\r
-        leaf node-ref {\r
-          type leafref {\r
-            path "../../../nd:supporting-node/nd:node-ref";\r
-          }\r
-          description\r
-            "This leaf identifies in which node the supporting\r
-             termination point is present.";\r
-        }\r
-        leaf tp-ref {\r
-          type leafref {\r
-            path "/nd:network[nd:network-id=current()/../"+\r
-              "network-ref]/nd:node[nd:node-id=current()/../"+\r
-              "node-ref]/termination-point/tp-id";\r
-          }\r
-          description\r
-            "Reference to the underlay node, must be in a\r
-             different topology";\r
-        }\r
-      }\r
-    }\r
-  }\r
-}\r
+module ietf-network-topology {
+  yang-version 1;
+  namespace "urn:ietf:params:xml:ns:yang:ietf-network-topology";
+  prefix lnk;
+
+  import ietf-inet-types {
+    prefix inet;
+  }
+  import ietf-network {
+    prefix nd;
+  }
+
+  organization "TBD";
+  contact
+    "WILL-BE-DEFINED-LATER";
+  description
+    "This module defines a common base model for network topology, 
+     augmenting the base network model with links to connect nodes, 
+     as well as termination points to terminate links on nodes.";
+
+  revision 2015-06-08 {
+    description
+      "Initial revision.";
+    reference "draft-ietf-i2rs-yang-network-topo-01";
+  }
+
+  typedef link-id {
+    type inet:uri;
+    description
+      "An identifier for a link in a topology.
+       The identifier may be opaque.
+       The identifier SHOULD be chosen such that the same link in a
+       real network topology will always be identified through the
+       same identifier, even if the model is instantiated in 
+          separate datastores. An implementation MAY choose to capture
+       semantics in the identifier, for example to indicate the type
+       of link and/or the type of topology that the link is a part 
+       of.";
+  }
+
+  typedef tp-id {
+    type inet:uri;
+    description
+      "An identifier for termination points on a node.
+       The identifier may be opaque.
+       The identifier SHOULD be chosen such that the same TP in a
+       real network topology will always be identified through the
+       same identifier, even if the model is instantiated in
+       separate datastores. An implementation MAY choose to capture
+       semantics in the identifier, for example to indicate the type
+       of TP and/or the type of node and topology that the TP is a 
+       part of.";
+  }
+
+  grouping link-ref {
+    description
+      "References a link in a specific network.";
+    leaf link-ref {
+      type leafref {
+        path "/nd:network[nd:network-id=current()/../"+
+          "nd:network-ref]/link/link-id";
+      }
+      description
+        "A type for an absolute reference a link instance.
+         (This type should not be used for relative references.
+         In such a case, a relative path should be used instead.)";
+    }
+    uses nd:network-ref;
+  }
+
+  grouping tp-ref {
+    description
+      "References a termination point in a specific node.";
+    leaf tp-ref {
+      type leafref {
+        path "/nd:network[nd:network-id=current()/../"+
+          "nd:network-ref]/nd:node[nd:node-id=current()/../"+
+          "nd:node-ref]/termination-point/tp-id";
+      }
+      description
+        "A type for an absolute reference to a termination point.
+         (This type should not be used for relative references.
+         In such a case, a relative path should be used instead.)";
+    }
+    uses nd:node-ref;
+  }
+
+  augment "/nd:network" {
+    description 
+      "Add links to the network model.";
+    list link {
+      key "link-id";
+      description
+        "A Network Link connects a by Local (Source) node and
+         a Remote (Destination) Network Nodes via a set of the
+         nodes' termination points.
+         As it is possible to have several links between the same
+         source and destination nodes, and as a link could
+         potentially be re-homed between termination points, to
+         ensure that we would always know to distinguish between
+         links, every link is identified by a dedicated link
+         identifier.
+         Note that a link models a point-to-point link, not a
+         multipoint link.
+         Layering dependencies on links in underlay topologies are
+         not represented as the layering information of nodes and of
+         termination points is sufficient.";
+      container source {
+        description
+          "This container holds the logical source of a particular
+           link.";
+        leaf source-node {
+          type leafref {
+            path "../../../nd:node/nd:node-id";
+          }
+          mandatory true;
+          description
+            "Source node identifier, must be in same topology.";
+        }
+        leaf source-tp {
+          type leafref {
+            path "../../../nd:node[nd:node-id=current()/../"+
+              "source-node]/termination-point/tp-id";
+          }
+          description
+            "Termination point within source node that terminates
+             the link.";
+        }
+      }
+      container destination {
+        description
+          "This container holds the logical destination of a
+           particular link.";
+        leaf dest-node {
+          type leafref {
+            path "../../../nd:node/nd:node-id";
+          }
+          mandatory true;
+          description
+            "Destination node identifier, must be in the same
+             network.";
+        }
+        leaf dest-tp {
+          type leafref {
+            path "../../../nd:node[nd:node-id=current()/../"+
+              "dest-node]/termination-point/tp-id";
+          }
+          description
+            "Termination point within destination node that
+             terminates the link.";
+        }
+      }
+      leaf link-id {
+        type link-id;
+        description
+          "The identifier of a link in the topology.
+           A link is specific to a topology to which it belongs.";
+      }
+      list supporting-link {
+        key "network-ref link-ref";
+        description
+          "Identifies the link, or links, that this link
+           is dependent on.";
+        leaf network-ref {
+          type leafref {
+            path "../../../nd:supporting-network/nd:network-ref";
+          }
+          description
+            "This leaf identifies in which underlay topology
+             supporting link is present.";
+        }
+        leaf link-ref {
+          type leafref {
+            path "/nd:network[nd:network-id=current()/.."+
+              "/network-ref]/link/link-id";
+          }
+          description
+            "This leaf identifies a link which is a part
+             of this link's underlay. Reference loops, in which
+             a link identifies itself as its underlay, either
+             directly or transitively, are not allowed.";
+        }
+      }
+    }
+  }
+  augment "/nd:network/nd:node" {
+    description
+      "Augment termination points which terminate links.  
+       Termination points can ultimately be mapped to interfaces.";
+    list termination-point {
+      key "tp-id";
+      description
+        "A termination point can terminate a link.
+         Depending on the type of topology, a termination point
+         could, for example, refer to a port or an interface.";
+      leaf tp-id {
+        type tp-id;
+        description
+          "Termination point identifier.";
+      }
+      list supporting-termination-point {
+        key "network-ref node-ref tp-ref";
+        description
+          "The leaf list identifies any termination points that
+           the termination point is dependent on, or maps onto.
+           Those termination points will themselves be contained
+           in a supporting node.
+           This dependency information can be inferred from
+           the dependencies between links.  For this reason,
+           this item is not separately configurable.  Hence no
+           corresponding constraint needs to be articulated.
+           The corresponding information is simply provided by the
+           implementing system.";
+        leaf network-ref {
+          type leafref {
+            path "../../../nd:supporting-node/nd:network-ref";
+          }
+          description
+            "This leaf identifies in which topology the
+             supporting termination point is present.";
+        }
+        leaf node-ref {
+          type leafref {
+            path "../../../nd:supporting-node/nd:node-ref";
+          }
+          description
+            "This leaf identifies in which node the supporting
+             termination point is present.";
+        }
+        leaf tp-ref {
+          type leafref {
+            path "/nd:network[nd:network-id=current()/../"+
+              "network-ref]/nd:node[nd:node-id=current()/../"+
+              "node-ref]/termination-point/tp-id";
+          }
+          description
+            "Reference to the underlay node, must be in a
+             different topology";
+        }
+      }
+    }
+  }
+}