New API for GNPy
[transportpce.git] / api / src / main / yang / gnpy-network-topology@2022-02-21.yang
similarity index 53%
rename from api/src/main/yang/gnpy-network-topology@2021-08-31.yang
rename to api/src/main/yang/gnpy-network-topology@2022-02-21.yang
index b20f1ed30f4fb530d5c155c48d0996ee7170c3d9..390831780bd9ac2049ba7be1882a872310281ecf 100644 (file)
@@ -1,10 +1,7 @@
 module gnpy-network-topology {
-  yang-version 1;
+  yang-version 1.1;
   namespace "gnpy:gnpy-network-topology";
   prefix gnpynt;
-  import ietf-inet-types {
-    prefix inet;
-  }
 
   organization
     "Telecom Infra Project OOPT PSE Working Group";
@@ -14,20 +11,60 @@ module gnpy-network-topology {
      contact:  <mailto:esther.lerouzic@orange.com>
     ";
   description
-    "YANG model for gnpy network input for path computation - transportPCE preversion";
+    "YANG model for gnpy network input -
+    The license used for all the yang files of GNPy is BSD 3-Clause License
+
+    BSD 3-Clause License
+
+    Copyright (c) 2018, Telecom Infra Project
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+      list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
 
-  revision 2021-08-31 {
+    * Neither the name of the copyright holder nor the names of its
+      contributors may be used to endorse or promote products derived from
+      this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2022-02-21 {
     description
-      "Change absolute path in leafref";
+      "draft for GNPy4TPCE preversion - non official version relevant for v2.4 GNPy file format";
+    reference
+      "YANG model for api input for path computation with gnpy";
   }
 
-  revision 2018-12-14 {
+  revision 2020-10-22 {
     description
-      "first draft";
+      "draft for experimental/2020-candi";
     reference
       "YANG model for network input for path computation with gnpy";
   }
 
+  revision 2019-01-03 {
+    description
+      "first draft for GNPy4TPCE preversion - non official version relevant for v1.2 GNPy file format";
+    reference
+      "YANG model for api input for path computation with gnpy";
+  }
+
   identity type-element {
     description
       "Base identity for element type";
@@ -42,7 +79,7 @@ module gnpy-network-topology {
   identity Fiber {
     base type-element;
     description
-      "Fiber element";
+      "Fiber element (unidirectional)";
   }
 
   identity Roadm {
@@ -60,7 +97,9 @@ module gnpy-network-topology {
   identity Fused {
     base type-element;
     description
-      "Fused element";
+      "Fused element ; non amplified connection between two fiber spans ;
+       can be used to model optical distribution frame, or losses due to
+       connectors or fused in a span";
   }
 
   identity length-unit {
@@ -86,16 +125,6 @@ module gnpy-network-topology {
     }
   }
 
-  typedef te-node-id {
-    type inet:ip-address;
-    description
-      "An identifier for a node in a topology.
-       The identifier is represented as 32-bit unsigned integer in
-       the dotted-quad notation.
-       This attribute is mapped to Router ID in
-       RFC3630, RFC5329, RFC5305, and RFC6119.";
-  }
-
   typedef Coef {
     type decimal64 {
       fraction-digits 2;
@@ -137,6 +166,8 @@ module gnpy-network-topology {
         fraction-digits 2;
       }
       mandatory true;
+      units db/km;
+      description "Loss coefficient of the fiber span (dB/km)";
     }
     leaf length_units {
       type identityref {
@@ -148,18 +179,21 @@ module gnpy-network-topology {
       type decimal64 {
         fraction-digits 2;
       }
+      units "dB";
       mandatory true;
     }
     leaf con_in {
       type decimal64 {
         fraction-digits 2;
       }
+      units "dB";
       mandatory true;
     }
     leaf con_out {
       type decimal64 {
         fraction-digits 2;
       }
+      units "dB";
       mandatory true;
     }
   }
@@ -168,16 +202,16 @@ module gnpy-network-topology {
     container operational {
       description
         "Operational values for the Edfa ";
-      leaf gain-target {
+      leaf gain_target {
         type decimal64 {
           fraction-digits 2;
         }
         units "dB";
         mandatory true;
         description
-          "..";
+          "gain target of the amplifier (before VOA and after att_in)";
       }
-      leaf tilt-target {
+      leaf tilt_target {
         type decimal64 {
           fraction-digits 2;
         }
@@ -185,7 +219,7 @@ module gnpy-network-topology {
         description
           "..";
       }
-      leaf out-voa {
+      leaf out_voa {
         type decimal64 {
           fraction-digits 2;
         }
@@ -194,6 +228,15 @@ module gnpy-network-topology {
         description
           "..";
       }
+      leaf delta_p {
+        type decimal64 {
+          fraction-digits 2;
+        }
+        units "dB";
+        mandatory true;
+        description
+          "per channel target output power delta with respect to power setting in SI";
+      }
     }
   }
 
@@ -206,11 +249,32 @@ module gnpy-network-topology {
       description
         "..";
     }
+    container restrictions {
+      leaf-list preamp_variety_list {
+        type string;
+        description
+          "List of authorized preamp type-variety";
+      }
+      leaf-list booster_variety_list {
+        type string;
+        description
+          "List of authorized booster type-variety";
+      }
+    }
   }
 
   grouping transceiver-params;
 
-  grouping fused-params;
+  grouping fused-params{
+    leaf loss {
+      type decimal64 {
+        fraction-digits 2;
+      }
+      units "dB";
+      description
+        "Concentrated loss of the fused element";
+    }
+  }
 
   grouping element-type-choice {
     choice element-type {
@@ -220,7 +284,7 @@ module gnpy-network-topology {
       }
       case FiberRoadm {
         container params {
-          choice fiberroadm {
+          choice fiberroadmfused {
             case Fiber {
               when "type = 'Fiber'";
               uses fiber-params;
@@ -229,18 +293,20 @@ module gnpy-network-topology {
               when "type = 'Roadm'";
               uses roadm-params;
             }
+            case Fused {
+              when "type = 'Fused'";
+              uses fused-params;
+            }
           }
         }
       }
       case Transceiver {
         when "type = 'Transceiver'";
       }
-      case Fused {
-        when "type = 'Fused'";
-      }
     }
   }
 
+
   grouping topo {
     list elements {
       key "uid";
@@ -266,12 +332,12 @@ module gnpy-network-topology {
       config false;
       leaf from_node {
         type leafref {
-          path ../../elements/uid;
+          path "../../elements/uid";
         }
       }
       leaf to_node {
         type leafref {
-          path ../../elements/uid;
+          path "../../elements/uid";
         }
       }
     }