Merge branch 'pm_phase2' into v2.0
[osm/SO.git] / models / plugins / yang / nsd.yang
index ac0987c..7818391 100644 (file)
@@ -119,43 +119,11 @@ module nsd
     }
 
     leaf parameter-pool {
     }
 
     leaf parameter-pool {
-      description "NSD Parameter pool name to use for this paramter";
+      description "NSD parameter pool name to use for this parameter";
       type string;
     }
   }
 
       type string;
     }
   }
 
-  grouping ns-initial-config-primitive {
-    leaf seq {
-      description
-          "Sequence number for the configuration primitive.";
-      type uint64;
-    }
-
-    leaf name {
-      description
-          "Name of the configuration primitive.";
-      type string;
-      mandatory "true";
-    }
-
-    leaf user-defined-script {
-      description
-          "A user defined script.";
-      type string;
-    }
-
-    list parameter {
-      key "name";
-      leaf name {
-        type string;
-      }
-
-      leaf value {
-        type string;
-      }
-    }
-  }
-
   grouping nsd-descriptor {
     leaf id {
       description "Identifier for the NSD.";
   grouping nsd-descriptor {
     leaf id {
       description "Identifier for the NSD.";
@@ -169,7 +137,7 @@ module nsd
     }
 
     leaf short-name {
     }
 
     leaf short-name {
-      description "NSD short name.";
+      description "Short name to appear as label in the UI";
       type string;
     }
 
       type string;
     }
 
@@ -180,8 +148,8 @@ module nsd
 
     leaf logo {
       description
 
     leaf logo {
       description
-        "File path for  the vendor specific logo. For example icons/mylogo.png.
-         The logo  should be part of the network service";
+        "File path for the vendor-specific logo. For example, icons/mylogo.png.
+         The logo should be part of the network service";
       type string;
     }
 
       type string;
     }
 
@@ -198,16 +166,11 @@ module nsd
     list connection-point {
       description
           "List for external connection points.
     list connection-point {
       description
           "List for external connection points.
-          Each NS has one or more external connection
-          points. As the name implies that external
-          connection points are used for connecting
-          the NS to other NS or to external networks.
-          Each NS exposes these connection points to
-          the orchestrator. The orchestrator can
-          construct network service chains by
-          connecting the connection points between
-          different NS.";
-
+          Each network service (NS) has one or more external connection
+          points that connect the NS to other NSs or to external networks.
+          Each NS exposes connection points to the orchestrator, which can
+          construct network service chains by connecting the connection
+          points between different NSs.";
       key "name";
       leaf name {
         description
       key "name";
       leaf name {
         description
@@ -222,12 +185,12 @@ module nsd
       }
     }
 
       }
     }
 
-    /* Still having issues modelling this,
+    /* Model Limitations,
        see the comments under vnfd-connection-point-ref
      */
     list vld {
       description
        see the comments under vnfd-connection-point-ref
      */
     list vld {
       description
-          "List of Virtual Link Descriptors.";
+          "List of Virtual Link Descriptors (VLDs).";
 
       key "id";
 
 
       key "id";
 
@@ -245,7 +208,7 @@ module nsd
 
       leaf short-name {
         description
 
       leaf short-name {
         description
-            "Short name for VLD for UI";
+            "Short name to appear as label in the UI";
         type string;
       }
 
         type string;
       }
 
@@ -283,7 +246,7 @@ module nsd
       list vnfd-connection-point-ref {
         description
             "A list of references to connection points.";
       list vnfd-connection-point-ref {
         description
             "A list of references to connection points.";
-        key "member-vnf-index-ref";
+        key "member-vnf-index-ref vnfd-connection-point-ref";
 
         leaf member-vnf-index-ref {
           description "Reference to member-vnf within constituent-vnfds";
 
         leaf member-vnf-index-ref {
           description "Reference to member-vnf within constituent-vnfds";
@@ -292,40 +255,35 @@ module nsd
           }
         }
 
           }
         }
 
-         leaf vnfd-id-ref {
-           description
-               "A reference to a vnfd. This is a
-                leafref to path:
-                    ../../nsd:constituent-vnfd
-                    + [nsd:id = current()/../nsd:id-ref]
-                    + /nsd:vnfd-id-ref
-                NOTE: An issue with confd is preventing the
-                use of xpath. Seems to be an issue with leafref
-                to leafref, whose target is in a different module.
-                Once that is resovled this will switched to use
-                leafref";
-           type string;
-         }
-
-         leaf vnfd-connection-point-ref {
-           description
-               "A reference to a connection point name
-                in a vnfd. This is a leafref to path:
-                    /vnfd:vnfd-catalog/vnfd:vnfd
-                    + [vnfd:id = current()/../nsd:vnfd-id-ref]
-                    + /vnfd:connection-point/vnfd:name
-                NOTE: An issue with confd is preventing the
-                use of xpath. Seems to be an issue with leafref
-                to leafref, whose target is in a different module.
-                Once that is resovled this will switched to use
-                leafref";
-            type string;
+        leaf vnfd-id-ref {
+          description
+              "A reference to a VNFD";
+          type leafref {
+            path "../../../constituent-vnfd" +
+                 "[member-vnf-index = current()/../member-vnf-index-ref]" +
+                 "/vnfd-id-ref";
+          }
+        }
+
+        leaf vnfd-connection-point-ref {
+          description "A reference to a connection point name";
+          type leafref {
+            path "/vnfd:vnfd-catalog/vnfd:vnfd" +
+                 "[vnfd:id = current()/../vnfd-id-ref]/" +
+                 "vnfd:connection-point/vnfd:name";
+          }
         }
       }
 
       // replicate for pnfd container here
       uses manotypes:provider-network;
 
         }
       }
 
       // replicate for pnfd container here
       uses manotypes:provider-network;
 
+      leaf mgmt-network {
+         description "Flag indicating whether this network is a VIM management network"; 
+         type boolean;
+         default false;
+      }
+
       choice init-params {
         description "Extra parameters for VLD instantiation";
 
       choice init-params {
         description "Extra parameters for VLD instantiation";
 
@@ -337,12 +295,14 @@ module nsd
             type string;
           }
         }
             type string;
           }
         }
+
         case vim-network-profile {
           leaf ip-profile-ref {
             description "Named reference to IP-profile object";
             type string;
           } 
         case vim-network-profile {
           leaf ip-profile-ref {
             description "Named reference to IP-profile object";
             type string;
           } 
-        }   
+        }
+
       }
     }
 
       }
     }
 
@@ -356,8 +316,8 @@ module nsd
       leaf member-vnf-index {
         description
           "Identifier/index for the VNFD. This separate id
       leaf member-vnf-index {
         description
           "Identifier/index for the VNFD. This separate id
-           is required to ensure that multiple VNFs can be
-           part of single NS";
+           is required so that multiple VNFs can be part of 
+           single NS";
         type uint64;
       }
 
         type uint64;
       }
 
@@ -379,7 +339,7 @@ module nsd
 
     list scaling-group-descriptor {
       description
 
     list scaling-group-descriptor {
       description
-          "scaling group descriptor within this network service.
+          "Scaling group descriptor within this network service.
            The scaling group defines a group of VNFs,
            and the ratio of VNFs in the network service
            that is used as target for scaling action";
            The scaling group defines a group of VNFs,
            and the ratio of VNFs in the network service
            that is used as target for scaling action";
@@ -427,7 +387,7 @@ module nsd
           description
               "Operation to be applied to check between scaling criterias to 
                check if the scale out threshold condition has been met.
           description
               "Operation to be applied to check between scaling criterias to 
                check if the scale out threshold condition has been met.
-               Defauls to OR";
+               Defaults to OR";
           type scaling-criteria-operation;
           default OR;
         }
           type scaling-criteria-operation;
           default OR;
         }
@@ -442,7 +402,7 @@ module nsd
         leaf cooldown-time {
           description
             "The duration after a scaling-in/scaling-out action has been
         leaf cooldown-time {
           description
             "The duration after a scaling-in/scaling-out action has been
-            triggered, for which there will be no further optional";
+            triggered, for which there will be no further scaling activity";
           type uint32;
           mandatory true;
         }
           type uint32;
           mandatory true;
         }
@@ -454,18 +414,21 @@ module nsd
           key "name";
 
           leaf name {
           key "name";
 
           leaf name {
+            description "Name of the scaling criteria";
             type string;
           }
 
           leaf scale-in-threshold {
             description
             type string;
           }
 
           leaf scale-in-threshold {
             description
-                "Value below which scale-in requests are generated";
+                "Value below which scale-in requests are generated
+                 (depends on monitoring parameters)";
             type uint64;
           }
 
           leaf scale-out-threshold {
             description
             type uint64;
           }
 
           leaf scale-out-threshold {
             description
-                "Value above which scale-out requests are generated";
+                "Value above which scale-out requests are generated
+                 (depends on monitoring parameters)";
             type uint64;
           }
 
             type uint64;
           }
 
@@ -485,7 +448,7 @@ module nsd
         key "member-vnf-index-ref";
 
         leaf member-vnf-index-ref {
         key "member-vnf-index-ref";
 
         leaf member-vnf-index-ref {
-          description "member VNF index of this member VNF";
+          description "Member VNF index of this member VNF";
           type leafref {
             path "../../../constituent-vnfd/member-vnf-index";
           }
           type leafref {
             path "../../../constituent-vnfd/member-vnf-index";
           }
@@ -493,9 +456,9 @@ module nsd
 
         leaf count {
           description
 
         leaf count {
           description
-            "count of this member VNF  within this scaling group.
-             The count allows to define  the number of instances
-             when a scaling action targets this scaling group";
+            "Count of this member VNF  within this scaling group.
+             The count defines the number of instances when a
+             scaling action targets this scaling group.";
           type uint32;
           default 1;
         }
           type uint32;
           default 1;
         }
@@ -503,19 +466,20 @@ module nsd
 
       leaf min-instance-count {
         description
 
       leaf min-instance-count {
         description
-          "Minimum instances of the scaling group which are allowed.
-          These instances are created by default when the network service
-          is instantiated.";
+          "Minimum number of instances of the scaling group that
+          are allowed in a single network service. These instances
+          are created by default when the network service is 
+          instantiated.";
         type uint32;
         default 0;
       }
 
       leaf max-instance-count {
         description
         type uint32;
         default 0;
       }
 
       leaf max-instance-count {
         description
-          "Maximum instances of this scaling group that are allowed
-           in a single network service. The network service scaling
-           will fail, when the number of service group instances
-           exceed the max-instance-count specified.";
+          "Maximum number of instances of this scaling group that
+          are allowed in a single network service. The network 
+          service scaling fails when the number of service group
+          instances exceeds the max-instance-count specified.";
         type uint32;
         default 10;
       }
         type uint32;
         default 10;
       }
@@ -525,7 +489,7 @@ module nsd
         key "trigger";
 
         leaf trigger {
         key "trigger";
 
         leaf trigger {
-          description "scaling trigger";
+          description "Scaling trigger";
           type scaling-trigger;
         }
 
           type scaling-trigger;
         }
 
@@ -551,7 +515,7 @@ module nsd
         key "member-vnf-index-ref";
 
         leaf member-vnf-index-ref {
         key "member-vnf-index-ref";
 
         leaf member-vnf-index-ref {
-          description "member VNF index of this member VNF";
+          description "Member VNF index of this member VNF";
           type leafref {
             path "../../../constituent-vnfd/member-vnf-index";
           }
           type leafref {
             path "../../../constituent-vnfd/member-vnf-index";
           }
@@ -561,7 +525,9 @@ module nsd
           description
               "Identifier for the VNFD.";
           type leafref {
           description
               "Identifier for the VNFD.";
           type leafref {
-            path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
+            path "../../../constituent-vnfd" + 
+                 "[member-vnf-index = current()/../member-vnf-index-ref]" +
+                 "/vnfd-id-ref";
           }
         }
       }
           }
         }
       }
@@ -575,14 +541,14 @@ module nsd
       key vnf-source-ref;
       leaf vnf-source-ref {
         type leafref {
       key vnf-source-ref;
       leaf vnf-source-ref {
         type leafref {
-          path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
+          path "../../constituent-vnfd/vnfd-id-ref";
         }
       }
       leaf vnf-depends-on-ref {
         description
         }
       }
       leaf vnf-depends-on-ref {
         description
-            "Reference to VNF that sorce VNF depends.";
+            "Reference to VNF on which the source VNF depends.";
         type leafref {
         type leafref {
-          path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
+          path "../../constituent-vnfd/vnfd-id-ref";
         }
       }
     }
         }
       }
     }
@@ -607,7 +573,7 @@ module nsd
 
       leaf short-name {
         description
 
       leaf short-name {
         description
-            "Short name for VNFFGD for UI";
+            "Short name to appear as label in the UI";
         type string;
       }
 
         type string;
       }
 
@@ -664,32 +630,22 @@ module nsd
 
            leaf vnfd-id-ref {
              description
 
            leaf vnfd-id-ref {
              description
-                 "A reference to a vnfd. This is a
-                  leafref to path:
-                      ../../../../nsd:constituent-vnfd
-                      + [nsd:id = current()/../nsd:id-ref]
-                      + /nsd:vnfd-id-ref
-                  NOTE: An issue with confd is preventing the
-                  use of xpath. Seems to be an issue with leafref
-                  to leafref, whose target is in a different module.
-                  Once that is resovled this will switched to use
-                  leafref";
-             type string;
+                 "A reference to a vnfd";
+             type leafref {
+                path "../../../../constituent-vnfd" +
+                     "[member-vnf-index = current()/../member-vnf-index-ref]" +
+                     "/vnfd-id-ref";
+             }
            }
 
            leaf vnfd-connection-point-ref {
              description
            }
 
            leaf vnfd-connection-point-ref {
              description
-                 "A reference to a connection point name
-                  in a vnfd. This is a leafref to path:
-                      /vnfd:vnfd-catalog/vnfd:vnfd
-                      + [vnfd:id = current()/../nsd:vnfd-id-ref]
-                      + /vnfd:connection-point/vnfd:name
-                  NOTE: An issue with confd is preventing the
-                  use of xpath. Seems to be an issue with leafref
-                  to leafref, whose target is in a different module.
-                  Once that is resovled this will switched to use
-                  leafref";
-              type string;
+                 "A reference to a connection point name";
+             type leafref {
+               path "/vnfd:vnfd-catalog/vnfd:vnfd" +
+                    "[vnfd:id = current()/../vnfd-id-ref]/" +
+                    "vnfd:connection-point/vnfd:name";
+             }
           }
         }
       } //rsp
           }
         }
       } //rsp
@@ -729,32 +685,22 @@ module nsd
 
         leaf vnfd-id-ref {
           description
 
         leaf vnfd-id-ref {
           description
-              "A reference to a vnfd. This is a
-                  leafref to path:
-                      ../../../nsd:constituent-vnfd
-                      + [nsd:id = current()/../nsd:id-ref]
-                      + /nsd:vnfd-id-ref
-                  NOTE: An issue with confd is preventing the
-                  use of xpath. Seems to be an issue with leafref
-                  to leafref, whose target is in a different module.
-                  Once that is resovled this will switched to use
-                  leafref";
-          type string;
+              "A reference to a VNFD";
+          type leafref {
+              path "../../../constituent-vnfd" +
+                   "[member-vnf-index = current()/../member-vnf-index-ref]" +
+                   "/vnfd-id-ref";
+          }
         }
 
         leaf vnfd-connection-point-ref {
           description
         }
 
         leaf vnfd-connection-point-ref {
           description
-              "A reference to a connection point name
-                  in a vnfd. This is a leafref to path:
-                      /vnfd:vnfd-catalog/vnfd:vnfd
-                      + [vnfd:id = current()/../nsd:vnfd-id-ref]
-                      + /vnfd:connection-point/vnfd:name
-                  NOTE: An issue with confd is preventing the
-                  use of xpath. Seems to be an issue with leafref
-                  to leafref, whose target is in a different module.
-                  Once that is resovled this will switched to use
-                  leafref";
-          type string;
+              "A reference to a connection point name";
+          type leafref {
+              path "/vnfd:vnfd-catalog/vnfd:vnfd" +
+                   "[vnfd:id = current()/../vnfd-id-ref]/" +
+                   "vnfd:connection-point/vnfd:name";
+          }
         }
 
         list match-attributes {
         }
 
         list match-attributes {
@@ -771,7 +717,7 @@ module nsd
 
           leaf ip-proto {
             description
 
           leaf ip-proto {
             description
-                "IP Protocol.";
+                "Internet Protocol.";
             type uint8;
           }
 
             type uint8;
           }
 
@@ -798,22 +744,23 @@ module nsd
                 "Destination port number.";
             type inet:port-number;
           }
                 "Destination port number.";
             type inet:port-number;
           }
-          //TODO: Add more match criteria
         } //match-attributes
       } // classifier
     } // vnffgd
 
     list monitoring-param {
       description
         } //match-attributes
       } // classifier
     } // vnffgd
 
     list monitoring-param {
       description
-        "List of monitoring parameters from VNF's that should be
+        "List of monitoring parameters from VNFs that should be
         propogated up into NSR";
       key "id";
 
       leaf id {
         propogated up into NSR";
       key "id";
 
       leaf id {
+        description "Identifier for a monitoring parameter";
         type string;
       }
 
       leaf name {
         type string;
       }
 
       leaf name {
+        description "Name of the monitoring parameter";
         type string;
       }
 
         type string;
       }
 
@@ -823,22 +770,17 @@ module nsd
 
       list vnfd-monitoring-param {
         description "A list of VNFD monitoring params";
 
       list vnfd-monitoring-param {
         description "A list of VNFD monitoring params";
-        key "vnfd-id-ref vnfd-monitoring-param-ref";
+        key "member-vnf-index-ref vnfd-monitoring-param-ref";
 
         leaf vnfd-id-ref {
           description
 
         leaf vnfd-id-ref {
           description
-             "A reference to a vnfd. This is a
-              leafref to path:
-                  ../../../../nsd:constituent-vnfd
-                  + [nsd:id = current()/../nsd:id-ref]
-                  + /nsd:vnfd-id-ref
-              NOTE: An issue with confd is preventing the
-              use of xpath. Seems to be an issue with leafref
-              to leafref, whose target is in a different module.
-              Once that is resolved this will switched to use
-              leafref";
+             "A reference to a VNFD. This is a leafref";
 
 
-          type yang:uuid;
+          type leafref {
+            path "../../../constituent-vnfd" +
+                 "[member-vnf-index = current()/../member-vnf-index-ref]" +
+                 "/vnfd-id-ref";
+          }
         }
 
         leaf vnfd-monitoring-param-ref {
         }
 
         leaf vnfd-monitoring-param-ref {
@@ -850,10 +792,12 @@ module nsd
           }
         }
 
           }
         }
 
-        leaf-list member-vnf-index-ref {
-         description
-            "Optional reference to member-vnf within constituent-vnfds";
-         type uint64;
+        leaf member-vnf-index-ref {
+          description
+            "Mandatory reference to member-vnf within constituent-vnfds";
+          type leafref {
+            path "../../../constituent-vnfd/member-vnf-index";
+          }
         }
       }
     }
         }
       }
     }
@@ -862,8 +806,8 @@ module nsd
 
     list parameter-pool {
       description
 
     list parameter-pool {
       description
-        "Pool of parameter values which must be
-         pulled from during configuration";
+         "Pool of parameter values from which to choose during 
+         configuration.";  
       key "name";
 
       leaf name {
       key "name";
 
       leaf name {
@@ -874,7 +818,7 @@ module nsd
 
       container range {
         description
 
       container range {
         description
-            "Create a range of values to populate the pool with";
+            "Create a range of values from which to populate the pool with";
 
         leaf start-value {
           description
 
         leaf start-value {
           description
@@ -892,21 +836,96 @@ module nsd
       }
     }
 
       }
     }
 
-    uses manotypes:ns-service-primitive;
+    list service-primitive {
+      description
+          "Network service level service primitives.";
+
+      key "name";
+
+      leaf name {
+        description
+            "Name of the service primitive.";
+        type string;
+      }
+
+      list parameter {
+        description
+            "List of parameters for the service primitive.";
+
+        key "name";
+        uses manotypes:primitive-parameter;
+      }
+
+      uses manotypes:ui-primitive-group;
+
+      list vnf-primitive-group {
+        description
+            "List of service primitives grouped by VNF.";
+
+        key "member-vnf-index-ref";
+        leaf member-vnf-index-ref {
+          description
+              "Reference to member-vnf within constituent-vnfds";
+          type leafref {
+             path "../../../constituent-vnfd/member-vnf-index";
+          }
+        }
 
 
+        leaf vnfd-id-ref {
+          description
+              "A reference to a VNFD. This is a leafref";
+
+          type leafref {
+             path "../../../constituent-vnfd" +
+                "[member-vnf-index = current()/../member-vnf-index-ref]" + "/vnfd-id-ref";
+          }
+        }
+
+        leaf vnfd-name {
+          description
+              "Name of the VNFD";
+          type leafref {
+              path "/vnfd:vnfd-catalog/vnfd:vnfd"
+                    + "[vnfd:id = current()/../vnfd-id-ref]"
+                    + "/vnfd:name";
+          }
+        }
+
+        list primitive {
+          key "index";
+
+          leaf index {
+            description "Index of this primitive";
+            type uint32;
+          }
+
+          leaf name {
+            description "Name of the primitive in the VNF primitive ";
+            type string;
+          }
+        }
+      }
+
+      leaf user-defined-script {
+        description
+            "A user defined script.";
+        type string;
+      }
+    }
     list initial-config-primitive {
       rwpb:msg-new NsdInitialConfigPrimitive;
       description
         "Initial set of configuration primitives for NSD.";
       key "seq";
 
     list initial-config-primitive {
       rwpb:msg-new NsdInitialConfigPrimitive;
       description
         "Initial set of configuration primitives for NSD.";
       key "seq";
 
-      uses ns-initial-config-primitive;
+      uses manotypes:initial-config;
     }
 
     list key-pair {
       key "name";
       description "Used to configure the list of public keys to be injected as part
     }
 
     list key-pair {
       key "name";
       description "Used to configure the list of public keys to be injected as part
-          of ns instantiation";
+          of NS instantiation";
 
       leaf name {
         description "Name of this key pair";
 
       leaf name {
         description "Name of this key pair";
@@ -936,7 +955,7 @@ module nsd
       list key-pair {
         key "name";
         description "Used to configure the list of public keys to be injected as part
       list key-pair {
         key "name";
         description "Used to configure the list of public keys to be injected as part
-            of ns instantiation";
+            of NS instantiation";
 
         leaf name {
           description "Name of this key pair";
 
         leaf name {
           description "Name of this key pair";