VNFD and NSD updated to support VDU and NS scaling from NFVI and VNF metrics
[osm/IM.git] / models / yang / nsd-base.yang
index c332869..df99563 100644 (file)
@@ -31,6 +31,10 @@ module nsd-base
     prefix "manotypes";
   }
 
+  import vnfd {
+    prefix "vnfd";
+  }
+
   revision 2017-02-28 {
     description
       "Initial revision. This YANG file defines
@@ -57,17 +61,6 @@ module nsd-base
     }
   }
 
-  typedef scaling-policy-type {
-    type enumeration {
-      enum manual {
-        value 1;
-      }
-      enum automatic {
-        value 2;
-      }
-    }
-  }
-
   typedef scaling-criteria-operation {
     type enumeration {
       enum AND {
@@ -175,6 +168,71 @@ module nsd-base
             "Type of the connection point.";
         type manotypes:connection-point-type;
       }
+
+      leaf floating-ip-required {
+        description
+            "Boolean parameter to indicate whether the CP must be exposed.
+             A public IP address will be allocated to this CP if exposed is true.
+             The default is false meaning a floating IP address is not required.
+             It must be explicitly asked for a floating IP address to be allocated.";
+        type boolean;
+      }
+
+      choice connection {
+        description "Logical connection of the CP to a VLD or to a VNF CP";
+
+        case vld-ref {
+
+          leaf vld-id-ref {
+            description
+              "ID reference to a VLD in the NS";
+            type leafref {
+              path "../../vld/id";
+            }
+          }
+
+        }
+
+        case vnfd-connection-point-ref {
+
+          leaf member-vnf-index-ref {
+            description "Reference to member-vnf within constituent-vnfd";
+            type leafref {
+              path "../../constituent-vnfd/member-vnf-index";
+            }
+          }
+
+          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";
+            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
+                  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";
+            type leafref {
+              path "/vnfd:vnfd-catalog/vnfd:vnfd" +
+                   "[vnfd:id = current()/../vnfd-id-ref]" +
+                   "/vnfd:connection-point/vnfd:name";
+            }
+          }
+
+        }
+
+      }
+
     }
 
     list scaling-group-descriptor {
@@ -204,7 +262,7 @@ module nsd-base
         leaf scaling-type {
           description
               "Type of scaling";
-          type scaling-policy-type;
+          type manotypes:scaling-policy-type;
         }
 
         leaf enabled {
@@ -219,7 +277,7 @@ module nsd-base
               "Operation to be applied to check between scaling criterias to
                check if the scale in threshold condition has been met.
                Defaults to AND";
-          type scaling-criteria-operation;
+          type manotypes:scaling-criteria-operation;
           default AND;
         }
 
@@ -228,7 +286,7 @@ module nsd-base
               "Operation to be applied to check between scaling criterias to
                check if the scale out threshold condition has been met.
                Defauls to OR";
-          type scaling-criteria-operation;
+          type manotypes:scaling-criteria-operation;
           default OR;
         }
 
@@ -263,12 +321,28 @@ module nsd-base
             type uint64;
           }
 
+          leaf scale-in-relational-operation {
+            description
+              "The relational operator used to compare the monitoring param
+              against the scale-in-threshold.";
+            type manotypes:relational-operation-type;
+            default LE;
+          }
+
           leaf scale-out-threshold {
             description
                 "Value above which scale-out requests are generated";
             type uint64;
           }
 
+          leaf scale-out-relational-operation {
+            description
+              "The relational operator used to compare the monitoring param
+              against the scale-out-threshold.";
+            type manotypes:relational-operation-type;
+            default GE;
+          }
+
           leaf ns-monitoring-param-ref {
             description
                "Reference to the NS level monitoring parameter
@@ -326,7 +400,7 @@ module nsd-base
 
         leaf trigger {
           description "scaling trigger";
-          type scaling-trigger;
+          type manotypes:scaling-trigger;
         }
 
         leaf ns-service-primitive-name-ref {