Merge from OSM SO master
[osm/SO.git] / models / plugins / yang / nsr.yang
index 0917928..50bbc0d 100644 (file)
@@ -35,12 +35,16 @@ module nsr
     prefix "vld";
   }
 
-  import nsd {
-    prefix "nsd";
+  import nsd-base {
+    prefix "nsd-base";
   }
 
-  import vnfd {
-    prefix "vnfd";
+  import project-nsd {
+    prefix "project-nsd";
+  }
+
+  import project-vnfd {
+    prefix "project-vnfd";
   }
 
   import vnfr {
@@ -97,6 +101,64 @@ module nsr
     }
   }
 
+  grouping cloud-config {
+    description "List of cloud config parameters";
+
+    list ssh-authorized-key {
+      key "key-pair-ref";
+
+      description "List of authorized ssh keys as part of cloud-config";
+
+      leaf key-pair-ref {
+        description "A reference to the key pair entry in the global key pair table";
+        type leafref {
+          path "/nsr:key-pair/nsr:name";
+        }
+      }
+    }
+    list user {
+      key "name";
+
+      description "List of users to be added through cloud-config";
+      leaf name {
+        description "Name of the user ";
+        type string;
+      }
+      leaf user-info {
+        description "The user name's real name";
+        type string;
+      }
+      list ssh-authorized-key {
+        key "key-pair-ref";
+
+        description "Used to configure the list of public keys to be injected as part 
+                        of ns instantiation";
+
+        leaf key-pair-ref {
+          description "A reference to the key pair entry in the global key pair table";
+          type leafref {
+            path "/nsr:key-pair/nsr:name";
+          }
+        }
+      }
+    }
+  }
+
+  list key-pair {
+    key "name";
+    description "Used to configure the list of public keys to be injected as part
+                 of ns instantiation";
+    leaf name {
+      description "Name of this key pair";
+      type string;
+    }
+
+    leaf key {
+      description "Key associated with this key pair";
+      type string;
+    }
+  }
+
   augment "/rw-project:project" {
     list key-pair {
       key "name";
@@ -154,17 +216,19 @@ module nsr
         container nsd {
           description "NS descriptor used to instantiate this NS";
 
-          uses nsd:nsd-descriptor-common;
+          uses nsd-base:nsd-descriptor-common;
 
-          uses nsd:nsr-nsd-vld;
+          uses project-nsd:nsr-nsd-vld;
 
-          uses nsd:nsr-nsd-constituent-vnfd;
+          uses project-nsd:nsr-nsd-constituent-vnfd;
 
-          uses nsd:nsr-nsd-placement-groups;
+          uses project-nsd:nsr-nsd-placement-groups;
 
-          uses nsd:nsr-nsd-vnf-dependency;
+          uses project-nsd:nsr-nsd-vnf-dependency;
 
-          uses nsd:nsr-nsd-monitoring-param;
+          uses project-nsd:nsr-nsd-monitoring-param;
+
+          uses project-nsd:nsr-nsd-service-primitive;
         }
 
         uses ns-instance-config-params;
@@ -225,13 +289,13 @@ module nsr
         description
           "A reference to a vnfd. This is a
           leafref to path:
-          ../../../../nsd:constituent-vnfd
+          ../../../../project-nsd:constituent-vnfd
           + [id = current()/../id-ref]
-          + /nsd:vnfd-id-ref
+          + /project-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
+          Once that is resolved this will switched to use
           leafref";
         type yang:uuid;
       }
@@ -240,54 +304,15 @@ module nsr
         description
           "A reference to VNFD placement group";
         type leafref {
-          path "../../../../vnfd:vnfd-catalog/vnfd:vnfd[vnfd:id = " +
-            "current()/../vnfd-id-ref]/vnfd:placement-groups/vnfd:name";
+          path "../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd[project-vnfd:id = " +
+            "current()/../vnfd-id-ref]/project-vnfd:placement-groups/project-vnfd:name";
         }
       }
 
       uses manotypes:placement-group-input;
     }
 
-    list ssh-authorized-key {
-      key "key-pair-ref";
-
-      description "List of authorized ssh keys as part of cloud-config";
-
-      leaf key-pair-ref {
-        description "A reference to the key pair entry in the global key pair table";
-        type leafref {
-          path "../../../../key-pair/name";
-        }
-      }
-    }
-    list user {
-      key "name";
-
-      description "List of users to be added through cloud-config";
-      leaf name {
-        description "Name of the user ";
-        type string;
-      }
-
-      leaf user-info {
-        description "The user name's real name";
-        type string;
-      }
-
-      list ssh-authorized-key {
-        key "key-pair-ref";
-
-        description "Used to configure the list of public keys to be injected as part
-                        of ns instantiation";
-
-        leaf key-pair-ref {
-          description "A reference to the key pair entry in the global key pair table";
-          type leafref {
-            path "../../../../../key-pair/name";
-          }
-        }
-      }
-    }
+    uses cloud-config;
   }
 
   grouping vnffgr {
@@ -416,7 +441,7 @@ module nsr
             description
                 "Type of Service Function.
                 NOTE: This needs to map with Service Function Type in ODL to
-                support VNFFG. Service Function Type is manadatory param in ODL
+                support VNFFG. Service Function Type is mandatory param in ODL
                 SFC. This is temporarily set to string for ease of use";
             type string;
           }
@@ -839,7 +864,82 @@ module nsr
           type config-states;
         }
 
-        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
+                 "Reference to member-vnf within constituent-vnfds";
+
+              key "member-vnf-index-ref";
+              leaf member-vnf-index-ref {
+                description
+                   "Reference to member-vnf within constituent-vnfds";
+                type string;
+              }
+
+              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-name {
+                 description
+                   "Name of the VNFD";
+                 type string;
+              }
+
+              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 NsrInitialConfigPrimitive;
@@ -900,9 +1000,9 @@ module nsr
                        that produced this result";
             // TODO: Fix leafref
             type leafref {
-              path "../../../../nsd:nsd-catalog/nsd:nsd" +
-                "[nsd:id = current()/../../nsd-ref]" +
-                "/nsd:monitoring-param/nsd:id";
+              path "../../../../project-nsd:nsd-catalog/project-nsd:nsd" +
+                "[project-nsd:id = current()/../../nsd-ref]" +
+                "/project-nsd:monitoring-param/project-nsd:id";
             }
           }
 
@@ -1120,13 +1220,13 @@ module nsr
           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
+                   ../../../../project-nsd:constituent-vnfd
+                   + [project-nsd:id = current()/../project-nsd:id-ref]
+                   + /project-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
+               Once that is resolved this will switched to use
                leafref";
 
           type string;
@@ -1414,9 +1514,9 @@ module nsr
           description
             "A reference to a vnfd. This is a
           leafref to path:
-          ../../../../nsd:constituent-vnfd
-          + [id = current()/../nsd:id-ref]
-          + /nsd:vnfd-id-ref
+          ../../../../project-nsd:constituent-vnfd
+          + [id = current()/../project-nsd:id-ref]
+          + /project-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.
@@ -1430,8 +1530,8 @@ module nsr
             "A reference to VNFD placement group";
           type leafref {
             path "/rw-project:project[rw-project:name=current()/" +
-              "../../project-name]/vnfd:vnfd-catalog/vnfd:vnfd[vnfd:id = " +
-              "current()/../vnfd-id-ref]/vnfd:placement-groups/vnfd:name";
+              "../../project-name]/project-vnfd:vnfd-catalog/project-vnfd:vnfd[project-vnfd:id = " +
+              "current()/../vnfd-id-ref]/project-vnfd:placement-groups/project-vnfd:name";
           }
         }
 
@@ -1488,5 +1588,4 @@ module nsr
       }
     }
   }
-
 }