Fixed value of mandatory fields to be YANG compliant
[osm/IM.git] / models / yang / nsr.yang
index 7597a6f..49a44e3 100644 (file)
 
 module nsr
 {
-  namespace "urn:ietf:params:xml:ns:yang:nfvo:nsr";
+  namespace "urn:etsi:osm:yang:nsr";
   prefix "nsr";
 
-  import rw-pb-ext {
-    prefix "rwpb";
-  }
-
   import vlr {
     prefix "vlr";
   }
@@ -59,8 +55,8 @@ module nsr
     prefix "manotypes";
   }
 
-  import rw-project {
-    prefix "rw-project";
+  import osm-project {
+    prefix "osm-project";
   }
 
   revision 2017-02-08 {
@@ -76,6 +72,34 @@ module nsr
       "Derived from earlier versions of base YANG files";
   }
 
+  typedef vnffgr-operational-status {
+    type enumeration {
+      enum init;
+      enum running;
+      enum terminate;
+      enum terminated;
+      enum failed;
+    }
+  }
+
+  typedef ns-operational-status {
+    type enumeration {
+      enum init;
+      enum vl-init-phase;
+      enum vnf-init-phase;
+      enum running;
+      enum terminate;
+      enum vnf-terminate-phase;
+      enum vl-terminate-phase;
+      enum terminated;
+      enum failed;
+      enum scaling-out;
+      enum scaling-in;
+      enum vl-instantiate;
+      enum vl-terminate;
+    }
+  }
+
   typedef config-states {
     type enumeration {
       enum init;
@@ -137,7 +161,7 @@ module nsr
     }
   }
 
-  augment "/rw-project:project" {
+  augment "/osm-project:project" {
     list key-pair {
       key "name";
       description "Used to configure the list of public keys to be injected as part
@@ -154,18 +178,18 @@ module nsr
     }
   }
 
-  grouping event-service-primitive {
+  grouping event-config-primitive {
     leaf seq {
       description
-          "Sequence number for the service primitive.";
+          "Sequence number for the config primitive.";
       type uint64;
     }
 
     leaf name {
       description
-          "Name of the service primitive.";
+          "Name of the primitive.";
       type string;
-      mandatory "true";
+      mandatory true;
     }
 
     leaf user-defined-script {
@@ -186,13 +210,19 @@ module nsr
     }
   }
 
-  augment "/rw-project:project" {
+  augment "/osm-project:project" {
     container ns-instance-config {
 
       list nsr {
         key "id";
         unique "name";
 
+        leaf schema-version {
+          description "Schema version for the NSR. If unspecified, it assumes v3.0";
+          type string;
+          default "v3.0";
+        }
+
         leaf id {
           description "Identifier for the NSR.";
           type yang:uuid;
@@ -237,8 +267,6 @@ module nsr
           uses project-nsd:nsr-nsd-vnf-dependency;
 
           uses project-nsd:nsr-nsd-monitoring-param;
-
-          uses project-nsd:nsr-nsd-service-primitive;
         }
         uses ns-instance-config-params;
       }
@@ -378,15 +406,7 @@ module nsr
             terminated          : The VNFFGR is in the terminated state.
             failed              : The VNFFGR instantiation failed
           ";
-
-        type enumeration {
-          rwpb:enum-type "VnffgrOperationalStatus";
-          enum init;
-          enum running;
-          enum terminate;
-          enum terminated;
-          enum failed;
-        }
+        type vnffgr-operational-status;
       }
 
       list rsp {
@@ -464,7 +484,7 @@ module nsr
           }
 
           leaf member-vnf-index-ref {
-            type uint64;
+            type string;
           }
           leaf vnfd-id-ref {
             description
@@ -485,7 +505,16 @@ module nsr
                   path "../../../../../../vnfr:vnfr-catalog/vnfr:vnfr/vnfr:name";
                 }
           }
-          leaf vnfr-connection-point-ref {
+          leaf vnfr-ingress-connection-point-ref {
+            description
+                "A reference to a vnfr connection point.";
+            type leafref {
+              path "../../../../../../vnfr:vnfr-catalog/vnfr:vnfr"
+                 + "[vnfr:id = current()/../vnfr-id-ref]"
+                 + "/vnfr:connection-point/vnfr:name";
+            }
+          }
+          leaf vnfr-egress-connection-point-ref {
             description
                 "A reference to a vnfr connection point.";
             type leafref {
@@ -507,13 +536,9 @@ module nsr
               type string;
             }
             leaf port-id {
-              rwpb:field-inline "true";
-              rwpb:field-string-max 64;
               type string;
             }
             leaf vm-id {
-              rwpb:field-inline "true";
-              rwpb:field-string-max 64;
               type string;
             }
             leaf address {
@@ -598,13 +623,9 @@ module nsr
             }
           }
           leaf port-id {
-            rwpb:field-inline "true";
-            rwpb:field-string-max 64;
             type string;
           }
           leaf vm-id {
-            rwpb:field-inline "true";
-            rwpb:field-string-max 64;
             type string;
           }
           leaf ip-address {
@@ -617,7 +638,7 @@ module nsr
     }
   }
 
-  augment "/rw-project:project" {
+  augment "/osm-project:project" {
     container ns-instance-opdata {
       config false;
 
@@ -856,21 +877,11 @@ module nsr
             vl-terminate        : The NS is terminating a VL
           ";
 
-          type enumeration {
-            enum init;
-            enum vl-init-phase;
-            enum vnf-init-phase;
-            enum running;
-            enum terminate;
-            enum vnf-terminate-phase;
-            enum vl-terminate-phase;
-            enum terminated;
-            enum failed;
-            enum scaling-out;
-            enum scaling-in;
-            enum vl-instantiate;
-            enum vl-terminate;
-          }
+          type ns-operational-status;
+        }
+
+        container ns-configuration {
+          uses manotypes:vca-configuration;
         }
 
         leaf config-status {
@@ -882,102 +893,6 @@ module nsr
           type config-states;
         }
 
-        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 uint64;
-              }
-
-              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-service-primitive {
-          rwpb:msg-new NsrInitialServicePrimitive;
-          description
-            "Initial set of service primitives for NSD.";
-          key "seq";
-
-          uses event-service-primitive;
-        }
-
-        list terminate-service-primitive {
-          rwpb:msg-new NsrTerminateServicePrimitive;
-          description
-            "Set of service primitives to
-             execute during termination of NSD.";
-          key "seq";
-
-          uses event-service-primitive;
-        }
-
         list monitoring-param {
           description
             "List of NS level params.";
@@ -1149,19 +1064,19 @@ module nsr
     leaf nsr_id_ref {
       description "Reference to NSR ID ref";
       type leafref {
-        path "/rw-project:project[rw-project:name=current()/.." +
+        path "/osm-project:project[osm-project:name=current()/.." +
           "/nsr:project-name]/nsr:ns-instance-config/nsr:nsr/nsr:id";
       }
       mandatory true;
     }
   }
 
-  rpc get-ns-service-primitive-values {
-    description "Get the service primitive parameter values";
+  rpc get-ns-config-primitive-values {
+    description "Get the config primitive parameter values";
 
     input {
       leaf name {
-        description "Name of the NS service primitive group";
+        description "Name of the NS config primitive group";
         mandatory true;
         type string;
       }
@@ -1214,7 +1129,7 @@ module nsr
         leaf member-vnf-index-ref {
           description
               "Reference to member-vnf within constituent-vnfds";
-          type uint64;
+          type string;
         }
 
         leaf vnfd-id-ref {
@@ -1263,8 +1178,8 @@ module nsr
     }
   }
 
-  rpc exec-ns-service-primitive {
-    description "Executes a NS service primitive or script";
+  rpc exec-ns-config-primitive {
+    description "Executes a NS config primitive or script";
 
     input {
       leaf name {
@@ -1449,7 +1364,7 @@ module nsr
       leaf scaling-group-name-ref {
         description "name of the scaling group";
         type leafref {
-          path "/rw-project:project[rw-project:name=current()/.." +
+          path "/osm-project:project[osm-project:name=current()/.." +
             "/nsr:project-name]/nsr:ns-instance-config/nsr:nsr" +
             "[nsr:id=current()/../nsr:nsr_id_ref]/nsr:nsd" +
             "/nsr:scaling-group-descriptor/nsr:name";
@@ -1460,7 +1375,7 @@ module nsr
       leaf instance-id {
         description "id of the scaling group";
         type leafref {
-          path "/rw-project:project[rw-project:name=current()/.." +
+          path "/osm-project:project[osm-project:name=current()/.." +
             "/nsr:project-name]/nsr:ns-instance-config/nsr:nsr" +
             "[nsr:id=current()/../nsr:nsr_id_ref]" +
             "/nsr:scaling-group[nsr:scaling-group-name-ref=current()/.." +
@@ -1488,7 +1403,7 @@ module nsr
       leaf scaling-group-name-ref {
         description "name of the scaling group";
         type leafref {
-          path "/rw-project:project[rw-project:name=current()/.." +
+          path "/osm-project:project[osm-project:name=current()/.." +
             "/nsr:project-name]/nsr:ns-instance-config/nsr:nsr" +
             "[nsr:id=current()/../nsr:nsr_id_ref]/nsr:nsd" +
             "/nsr:scaling-group-descriptor/nsr:name";
@@ -1524,7 +1439,7 @@ module nsr
       leaf nsd_id_ref {
         description "Reference to NSD ID ref";
         type leafref {
-          path "/rw-project:project[rw-project:name=current()/.." +
+          path "/osm-project:project[osm-project:name=current()/.." +
             "/project-name]/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:id";
         }
       }
@@ -1556,7 +1471,7 @@ module nsr
           description
             "A reference to VNFD placement group";
           type leafref {
-            path "/rw-project:project[rw-project:name=current()/" +
+            path "/osm-project:project[osm-project:name=current()/" +
               "../../project-name]/project-vnfd:vnfd-catalog/project-vnfd:vnfd[project-vnfd:id = " +
               "current()/../vnfd-id-ref]/project-vnfd:placement-groups/project-vnfd:name";
           }
@@ -1572,7 +1487,7 @@ module nsr
           leaf key-pair-ref {
             description "A reference to the key pair entry in the global key pair table";
             type leafref {
-              path "/rw-project:project[rw-project:name=current()/../../../" +
+              path "/osm-project:project[osm-project:name=current()/../../../" +
                 "project-name]/key-pair/name";
             }
           }
@@ -1599,7 +1514,7 @@ module nsr
             leaf key-pair-ref {
               description "A reference to the key pair entry in the global key pair table";
               type leafref {
-                path "/rw-project:project[rw-project:name=current()/" +
+                path "/osm-project:project[osm-project:name=current()/" +
                   "../../../../project-name]/key-pair/name";
               }
             }