Revert "Revert "Re-enabling NS primitives, config-primitive over service-primitive...
[osm/IM.git] / models / yang / vnfr.yang
index d47c6a7..7a0594b 100644 (file)
 
 module vnfr
 {
-  namespace "urn:ietf:params:xml:ns:yang:nfvo:vnfr";
+  namespace "urn:etsi:osm:yang:vnfr";
   prefix "vnfr";
 
   import mano-types {
     prefix "manotypes";
   }
 
-  import rw-pb-ext {
-    prefix "rwpb";
-  }
-
   import vnfd-base {
     prefix "vnfd-base";
   }
@@ -55,8 +51,8 @@ module vnfr
     prefix "inet";
   }
 
-  import rw-project {
-    prefix "rw-project";
+  import osm-project {
+    prefix "osm-project";
   }
 
   revision 2017-02-28 {
@@ -72,6 +68,36 @@ module vnfr
       "Derived from earlier versions of base YANG files";
   }
 
+  typedef vdu-operational-status {
+    type enumeration {
+      enum init;
+      enum vm-init-phase;
+      enum vm-alloc-pending;
+      enum running;
+      enum upgrading;
+      enum terminate;
+      enum vl-terminate-phase;
+      enum terminated;
+      enum failed;
+    }
+  }
+
+  typedef vnf-operational-status {
+    type enumeration {
+      enum pre-init;
+      enum init;
+      enum vl-init-phase;
+      enum vm-init-phase;
+      enum running;
+      enum upgrading;   // Experimental
+      enum terminate;
+      enum vm-terminate-phase;
+      enum vl-terminate-phase;
+      enum terminated;
+      enum failed;
+    }
+  }
+
   grouping placement-group-info {
     list placement-groups-info {
       description
@@ -85,7 +111,6 @@ module vnfr
     }
   }
 
-
   grouping virtual-interface {
     container virtual-interface {
       description
@@ -95,10 +120,12 @@ module vnfr
         description
             "Specifies the type of virtual interface
              between VM and host.
-             VIRTIO          : Use the traditional VIRTIO interface.
+             PARAVIRT        : Use the default paravirtualized interface for the VIM (virtio, vmxnet3, etc.).
+             VIRTIO          : Deprecated! Use the traditional VIRTIO interface.
              PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
              SR-IOV          : Use SR-IOV interface.";
         type enumeration {
+          enum PARAVIRT;
           enum VIRTIO;
           enum PCI-PASSTHROUGH;
           enum SR-IOV;
@@ -170,8 +197,14 @@ module vnfr
     }
   }
 
-  augment "/rw-project:project" {
+  augment "/osm-project:project" {
     container vnfr-catalog {
+      leaf schema-version {
+        description "Schema version for the VNFR. If unspecified, it assumes v3.0";
+        type string;
+        default "v3.0";
+      }
+
       config false;
       list vnfr {
         description
@@ -258,9 +291,9 @@ module vnfr
         }
 
         // Use parameters provided here to configure this VNF
-      container vnf-configuration {
-        uses manotypes:vca-configuration;
-      }
+        container vnf-configuration {
+          uses manotypes:vca-configuration;
+        }
 
         // Mainly used by Mon-params & dashboard url
         container mgmt-interface {
@@ -331,6 +364,7 @@ module vnfr
               "IP address assigned to the external connection point";
             type inet:ip-address;
           }
+
           leaf mac-address {
             description
               "MAC address assigned to the external connection point";
@@ -364,8 +398,6 @@ module vnfr
             description "Short Unique name of the VDU
                   This will be of the format NSR name-ShortnedString-VDUname
                   NSR name and VDU name shall be constrained to 10 characters";
-            rwpb:field-inline "true";
-            rwpb:field-string-max 64;
             type string;
           }
 
@@ -413,9 +445,33 @@ module vnfr
 
           uses manotypes:supplemental-boot-data;
 
-        container vdu-configuration {
-          uses manotypes:vca-configuration;
-        }
+          container vdu-configuration {
+            uses manotypes:vca-configuration;
+          }
+
+          list monitoring-param {
+            description
+              "List of VDU-related monitoring parameters at NFVI level";
+            key id;
+            leaf id {
+              description "The unique id of the monitoring param at VDU level";
+              type string;
+            }
+
+            leaf nfvi-metric {
+              description "The associated NFVI metric to be monitored";
+              type manotypes:nfvi-metric-type;
+            }
+
+            leaf interface-name-ref {
+              description
+                "Reference to a VDU interface name. Applicable only when the nfvi-metric
+                refers to an interface and not to the VM";
+              type leafref {
+                path "../../interface/name";
+              }
+            }
+          }
 
           list volumes {
             key "name";
@@ -450,6 +506,7 @@ module vnfr
                 "IP address assigned to the internal connection point";
               type inet:ip-address;
             }
+
             leaf mac-address {
               description
                 "MAC address assigned to the internal connection point";
@@ -464,86 +521,143 @@ module vnfr
             uses associated-virtual-cps;
           }
 
-        list interface {
-          description
-              "List of interfaces (internal and external) for the VNF";
-          key name;
-
-          leaf name {
+          list interface {
             description
-                "Name of the interface. Note that this
-                name has only local significance to the VDU.";
-            type string;
+                "List of interfaces (internal and external) for the VNF";
+            key name;
+
+            leaf name {
+              description
+                  "Name of the interface. Note that this
+                  name has only local significance to the VDU.";
+              type string;
+            }
+
+            leaf position {
+              description
+                  "Explicit Position of the interface within the list";
+              type uint32;
+            }
+
+            leaf type {
+              description
+                  "Type of the Interface";
+
+              type vnfd-base:interface-type;
+
+              default "EXTERNAL";
+            }
+            choice connection-point-type {
+              case internal {
+                leaf internal-connection-point-ref {
+                  description
+                      "Leaf Ref to the particular internal connection point";
+                  type leafref {
+                    path "../../internal-connection-point/id";
+                  }
+                }
+              }
+              case external {
+                leaf external-connection-point-ref {
+                  description
+                      "Leaf Ref to the particular external connection point";
+                  type leafref {
+                    path "../../../connection-point/name";
+                  }
+                }
+              }
+            }
+            uses virtual-interface;
           }
 
-          leaf position {
+          leaf operational-status {
             description
-                "Explicit Position of the interface within the list";
-            type uint32;
+              "The operational status of the VDU
+                init                : The VDU has just started.
+                vm-init-phase       : The VDUs in the VNF is being created in VIM.
+                vm-alloc-pending    : The  VM alloc is pending in VIM
+                running             : The VDU is active in VM
+                upgrading           : The VDU is being upgraded (EXPERIMENTAL)
+                terminate           : The VDU is being terminated
+                vm-terminate-phase  : The VDU in the VNF is being terminated in VIM.
+                terminated          : The VDU is in the terminated state.
+                failed              : The VDU  instantiation failed.
+              ";
+            type vdu-operational-status;
           }
 
-          leaf type {
-            description
-                "Type of the Interface";
+          uses placement-group-info;
+        }
 
-            type vnfd-base:interface-type;
+        list monitoring-param {
+          description
+            "List of monitoring parameters at the network service level";
+          key id;
+          leaf id {
+            type string;
+          }
 
-            default "EXTERNAL";
+          leaf name {
+            type string;
           }
-          choice connection-point-type {
-            case internal {
-              leaf internal-connection-point-ref {
-                description
-                    "Leaf Ref to the particular internal connection point";
-                type leafref {
-                  path "../../internal-connection-point/id";
+
+          uses manotypes:monitoring-param-aggregation;
+
+          choice monitoring-type {
+            description
+              "Defines the type of monitoring param to be used:
+                * vdu-monitorin-param:     VDU-related metric (from NFVI)
+                * vnf-metric:              VNF-related metric (from VCA)
+                * vdu-metric:              VDU-related metric (from VCA)
+              ";
+
+            case vdu-monitoring-param {
+              description "VDU-related metric from the infrastructure";
+              container vdu-monitoring-param {
+                leaf vdu-ref {
+                  type leafref {
+                    path "../../../vdur/id";
+                  }
+                }
+                leaf vdu-monitoring-param-ref {
+                  type leafref {
+                    path "../../../vdur[id = current()/../vdu-ref]/monitoring-param/id";
+                  }
                 }
               }
             }
-            case external {
-              leaf external-connection-point-ref {
-                description
-                    "Leaf Ref to the particular external connection point";
-                type leafref {
-                  path "../../../connection-point/name";
+
+            case vnf-metric {
+              description "VNF-related metric (from VCA)";
+              container vnf-metric {
+                leaf vnf-metric-name-ref {
+                  type leafref {
+                    path "../../../vnf-configuration/metrics/name";
+                  }
                 }
               }
             }
-          }
-          uses virtual-interface;
-        }
-
-        leaf operational-status {
-          description
-            "The operational status of the VDU
-              init                : The VDU has just started.
-              vm-init-phase       : The VDUs in the VNF is being created in VIM.
-              vm-alloc-pending    : The  VM alloc is pending in VIM
-              running             : The VDU is active in VM
-              terminate           : The VDU is being terminated
-              vm-terminate-phase  : The VDU in the VNF is being terminated in VIM.
-              terminated          : The VDU is in the terminated state.
-              failed              : The VDU  instantiation failed.
-            ";
 
-            type enumeration {
-              rwpb:enum-type "VduOperationalStatus";
-              enum init;
-              enum vm-init-phase;
-              enum vm-alloc-pending;
-              enum running;
-              enum terminate;
-              enum vl-terminate-phase;
-              enum terminated;
-              enum failed;
+            case vdu-metric {
+              description "VDU-related metric (from VCA)";
+              container vdu-metric {
+                leaf vdu-ref {
+                  type leafref {
+                    path "../../../vdur/id";
+                  }
+                }
+                leaf vdu-metric-name-ref {
+                  type leafref {
+                    path "../../../vdur[id = current()/../vdu-ref]/vdu-configuration/metrics/name";
+                  }
+                }
+              }
             }
+
           }
 
-          uses placement-group-info;
         }
 
-        uses manotypes:monitoring-param;
-
         leaf operational-status {
           description
             "The operational status of the VNFR instance
@@ -558,20 +672,7 @@ module vnfr
               terminated          : The VNF is in the terminated state.
               failed              : The VNF instantiation failed
             ";
-
-          type enumeration {
-            rwpb:enum-type "VnfrOperationalStatus";
-            enum pre-init;
-            enum init;
-            enum vl-init-phase;
-            enum vm-init-phase;
-            enum running;
-            enum terminate;
-            enum vm-terminate-phase;
-            enum vl-terminate-phase;
-            enum terminated;
-            enum failed;
-          }
+          type vnf-operational-status;
         }
 
         leaf config-status {
@@ -599,7 +700,6 @@ module vnfr
         uses placement-group-info;
 
         container cloud-config {
-          rwpb:msg-new VnfrCloudConfig;
           uses manotypes:cloud-config;
         }
       }