Adding nst.yang and nsi.yang to data model.
[osm/IM.git] / models / yang / nsd-base.yang
index aded995..c164078 100644 (file)
@@ -61,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 {
@@ -111,7 +100,7 @@ module nsd-base
       description "NSD parameter pool name to use for this parameter";
       type string;
     }
-  }
+  } // primitive-parameter
 
   grouping nsd-descriptor-common {
     leaf id {
@@ -168,11 +157,7 @@ module nsd-base
           different NS.";
 
       key "name";
-      leaf name {
-        description
-            "Name of the NS connection point.";
-        type string;
-      }
+      uses nsd-connection-point-common;
 
       leaf type {
         description
@@ -180,15 +165,6 @@ module nsd-base
         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";
 
@@ -273,7 +249,7 @@ module nsd-base
         leaf scaling-type {
           description
               "Type of scaling";
-          type scaling-policy-type;
+          type manotypes:scaling-policy-type;
         }
 
         leaf enabled {
@@ -288,7 +264,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;
         }
 
@@ -297,7 +273,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;
         }
 
@@ -332,12 +308,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
@@ -395,7 +387,7 @@ module nsd-base
 
         leaf trigger {
           description "scaling trigger";
-          type scaling-trigger;
+          type manotypes:scaling-trigger;
         }
 
         leaf ns-service-primitive-name-ref {
@@ -414,113 +406,71 @@ module nsd-base
 
       key "id";
 
-      leaf id {
-        description
-            "Identifier for the VNFFGD.";
-        type string;
-      }
-
-      leaf name {
-        description
-            "VNFFGD name.";
-        type string;
-      }
-
-      leaf short-name {
-        description
-            "Short name to appear as label in the UI";
-        type string;
-      }
-
-      leaf vendor {
-        description "Provider of the VNFFGD.";
-        type string;
-      }
-
-      leaf description {
-        description "Description of the VNFFGD.";
-        type string;
-      }
-
-      leaf version {
-        description "Version of the VNFFGD";
-        type string;
-      }
+      uses fgd-common;
 
       list rsp {
         description
           "List of Rendered Service Paths (RSP).";
-
         key "id";
 
-        leaf id {
-          description
-            "Identifier for the RSP.";
-          type string;
+        uses rsp-common;
+
+        list vnfd-connection-point-ref { // not common
+        description
+          "A list of references to connection points.";
+        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 name {
+        leaf order {
+          type uint8;
           description
-            "RSP name.";
-          type string;
+            "A number that denotes the order of a VNF in a chain";
         }
 
-        list vnfd-connection-point-ref {
+        leaf vnfd-id-ref {
           description
-            "A list of references to connection points.";
-          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 order {
-            type uint8;
-            description
-              "A number that denotes the order of a VNF in a chain";
-          }
-
-          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";
-             }
+            "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
-                  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";
-            // TODO: Keeping as string as this needs to be
-            // diffenent lvel based of if it is nsd-catalog or
-            // in nsr.
-            // type leafref {
-            //   path "../../../../../../vnfd:vnfd-catalog/vnfd:vnfd" +
-            //        "[vnfd:id = current()/../vnfd-id-ref]/" +
-            //        "vnfd:connection-point/vnfd:name";
-            // }
-            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 resolved this will switched to use
+                leafref";
+          // TODO: Keeping as string as this needs to be
+          // diffenent lvel based of if it is nsd-catalog or
+          // in nsr.
+          // type leafref {
+          //   path "../../../../../../vnfd:vnfd-catalog/vnfd:vnfd" +
+          //        "[vnfd:id = current()/../vnfd-id-ref]/" +
+          //        "vnfd:connection-point/vnfd:name";
+          // }
+          type string;
         }
+      }
       } //rsp
 
       list classifier {
@@ -529,25 +479,7 @@ module nsd-base
 
         key "id";
 
-        leaf id {
-          description
-              "Identifier for the classifier rule.";
-          type string;
-        }
-
-        leaf name {
-          description
-              "Name of the classifier.";
-          type string;
-        }
-
-        leaf rsp-id-ref {
-          description
-              "A reference to the RSP.";
-          type leafref {
-            path "../../rsp/id";
-          }
-        }
+        uses classifier-common;
 
         leaf member-vnf-index-ref {
           description "Reference to member-vnf within constituent-vnfds";
@@ -593,51 +525,8 @@ module nsd-base
           // }
           type string;
         }
-
-        list match-attributes {
-          description
-              "List of match attributes.";
-
-          key "id";
-
-          leaf id {
-            description
-                "Identifier for the classifier match attribute rule.";
-            type string;
-          }
-
-          leaf ip-proto {
-            description
-                "IP Protocol.";
-            type uint8;
-          }
-
-          leaf source-ip-address {
-            description
-                "Source IP address.";
-            type inet:ip-address;
-          }
-
-          leaf destination-ip-address {
-            description
-                "Destination IP address.";
-            type inet:ip-address;
-          }
-
-          leaf source-port {
-            description
-                "Source port number.";
-            type inet:port-number;
-          }
-
-          leaf destination-port {
-            description
-                "Destination port number.";
-            type inet:port-number;
-          }
-          //TODO: Add more match criteria
-        } //match-attributes
       } // classifier
+
     } // vnffgd
 
     uses manotypes:ip-profile-list;
@@ -739,12 +628,60 @@ module nsd-base
         }
       }
     }
-  }
+  } // nsd-descriptor-common
 
   grouping nsd-vld-common {
     /* Still having issues modelling this,
        see the comments under vnfd-connection-point-ref
+
+       IMPORTANT: Change description fields
     */
+    uses vld-common;
+
+    choice init-params {
+      description "Extra parameters for VLD instantiation";
+
+      case vim-network-ref {
+        leaf vim-network-name {
+          description
+            "Name of network in VIM account. This is used to indicate
+                   pre-provisioned network name in cloud account.";
+          type string;
+        }
+      }
+
+      case vim-network-profile {
+        leaf ip-profile-ref {
+          description "Named reference to IP-profile object";
+          type leafref {
+            path "../../ip-profiles/name";
+          }
+        }
+      }
+
+    }
+  } // nsd-vld-common
+
+  grouping nsd-connection-point-common {
+    description "NSD connection point base";
+    //IMPORTANT: Change description fields
+    leaf name {
+      description
+          "Name of the connection point.";
+      type string;
+    }
+
+    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;
+    }
+  } // nsd-connection-point-common
+
+  grouping vld-common {
     description
       "List of Virtual Link Descriptors.";
 
@@ -805,30 +742,126 @@ module nsd-base
       type boolean;
       default false;
     }
+  } // vld-common
 
-    choice init-params {
-      description "Extra parameters for VLD instantiation";
+  grouping fgd-common {
 
-      case vim-network-ref {
-        leaf vim-network-name {
-          description
-            "Name of network in VIM account. This is used to indicate
-                   pre-provisioned network name in cloud account.";
-          type string;
-        }
+    leaf id {
+      description
+          "Identifier for the FGD.";
+      type string;
+    }
+
+    leaf name {
+      description
+          "FGD name.";
+      type string;
+    }
+
+    leaf short-name {
+      description
+          "Short name to appear as label in the UI";
+      type string;
+    }
+
+    leaf vendor {
+      description "Provider of the FGD.";
+      type string;
+    }
+
+    leaf description {
+      description "Description of the FGD.";
+      type string;
+    }
+
+    leaf version {
+      description "Version of the FGD";
+      type string;
+    }
+  } // fgd-common
+
+  grouping rsp-common {
+
+    leaf id {
+      description
+        "Identifier for the RSP.";
+      type string;
+    }
+
+    leaf name {
+      description
+        "RSP name.";
+      type string;
+    }
+
+  } // rsp-common
+
+  grouping classifier-common {
+
+    leaf id {
+      description
+          "Identifier for the classifier rule.";
+      type string;
+    }
+
+    leaf name {
+      description
+          "Name of the classifier.";
+      type string;
+    }
+
+    leaf rsp-id-ref {
+      description
+          "A reference to the RSP.";
+      type leafref {
+        path "../../rsp/id";
       }
+    }
 
-      case vim-network-profile {
-        leaf ip-profile-ref {
-          description "Named reference to IP-profile object";
-          type leafref {
-            path "../../ip-profiles/name";
-          }
-        }
+    list match-attributes {
+      description
+          "List of match attributes.";
+
+      key "id";
+
+      leaf id {
+        description
+            "Identifier for the classifier match attribute rule.";
+        type string;
       }
 
-    }
-  }
+      leaf ip-proto {
+        description
+            "IP Protocol.";
+        type uint8;
+      }
+
+      leaf source-ip-address {
+        description
+            "Source IP address.";
+        type inet:ip-address;
+      }
+
+      leaf destination-ip-address {
+        description
+            "Destination IP address.";
+        type inet:ip-address;
+      }
+
+      leaf source-port {
+        description
+            "Source port number.";
+        type inet:port-number;
+      }
+
+      leaf destination-port {
+        description
+            "Destination port number.";
+        type inet:port-number;
+      }
+      //TODO: Add more match criteria
+    } //match-attributes
+  } // classifier-common
 
   grouping monitoring-param-common {
     description
@@ -846,5 +879,5 @@ module nsd-base
     uses manotypes:monitoring-param-value;
     uses manotypes:monitoring-param-ui-data;
     uses manotypes:monitoring-param-aggregation;
-  }
+  } // monitoring-param-common
 }