Removed ns-configuration grouping; updated descriptions
[osm/IM.git] / models / yang / mano-types.yang
index 26eb420..1b9e141 100644 (file)
 
 module mano-types
 {
-  namespace "urn:ietf:params:xml:ns:yang:nfvo:mano-types";
+  namespace "urn:etsi:osm:yang:mano-types";
   prefix "manotypes";
 
   import ietf-inet-types {
     prefix "inet";
   }
 
-  import rw-project {
-    prefix "rw-project";
+  import osm-project {
+    prefix "osm-project";
   }
 
   revision 2017-02-08 {
@@ -78,6 +78,12 @@ module mano-types
         type string;
       }
 
+      leaf data-type {
+        description
+            "Data type associated with the value.";
+        type manotypes:parameter-data-type;
+      }
+
       leaf value {
         description
             "Value associated with the name.";
@@ -237,13 +243,21 @@ module mano-types
     }
   }
 
-  grouping vca-configuration {
+  grouping vca-metrics {
     description
-        "Information about the VNF or VDU configuration. Note:
-         If the NS contains multiple instances of the
-         same VNF or VDU, each instance could have a different
-         configuration.";
+        "Information about the VNF or VDU metrics";
+    list metrics {
+      description "List of VCA related metrics";
+      key "name";
+      leaf name {
+        description
+          "Name of the metric, as defined in the Juju charm.";
+        type string;
+      }
+    }
+  } // END - grouping vca-metrics
 
+  grouping configuration-method {
     choice config-method {
       description
           "Defines the configuration method for the VNF or VDU.";
@@ -281,6 +295,16 @@ module mano-types
         }
       }
     }
+  }
+
+  grouping vca-configuration {
+    description
+        "Common information in the descriptors for NS, VNF or VDU configuration.
+         Note: If the NS contains multiple instances of the
+         same VNF or VDU, each instance could have a different
+         configuration.";
+
+    uses manotypes:configuration-method;
 
     list config-primitive {
       description
@@ -337,6 +361,32 @@ module mano-types
         }
       }
     }
+
+    list terminate-config-primitive {
+      description
+        "Terminate set of configuration primitives.";
+      key "seq";
+      leaf seq {
+        description
+          "Sequence number for the configuration primitive.";
+        type uint64;
+      }
+      leaf name {
+        description
+          "Name of the configuration primitive.";
+        type string;
+      }
+
+      uses primitive-parameter-value;
+
+      leaf user-defined-script {
+        description
+          "A user defined script.";
+        type string;
+      }
+    }
+    uses manotypes:vca-metrics;
+
   } // END - grouping vca-configuration
 
   typedef virtual-link-type {
@@ -622,6 +672,61 @@ module mano-types
     }
   }
 
+  typedef nfvi-metric-type {
+    description "Type of NFVI metric to be monitored";
+    type enumeration {
+      enum cpu_utilization;
+      enum average_memory_utilization;
+      enum disk_read_ops;
+      enum disk_write_ops;
+      enum disk_read_bytes;
+      enum disk_write_bytes;
+      enum packets_sent;
+      enum packets_received;
+      enum packets_in_dropped;
+      enum packets_out_dropped;
+    }
+  }
+
+  typedef scaling-trigger {
+    type enumeration {
+      enum pre-scale-in {
+        value 1;
+      }
+      enum post-scale-in {
+        value 2;
+      }
+      enum pre-scale-out {
+        value 3;
+      }
+      enum post-scale-out {
+        value 4;
+      }
+    }
+  }
+
+  typedef scaling-policy-type {
+    type enumeration {
+      enum manual {
+        value 1;
+      }
+      enum automatic {
+        value 2;
+      }
+    }
+  }
+
+  typedef scaling-criteria-operation {
+    type enumeration {
+      enum AND {
+        value 1;
+      }
+      enum OR {
+        value 2;
+      }
+    }
+  }
+
   grouping vm-flavor {
     container vm-flavor {
       leaf vcpu-count {
@@ -778,7 +883,6 @@ module mano-types
         }
       }
 
-
       leaf om-cpu-model-string {
         description "OpenMANO CPU model string";
         type string;
@@ -792,6 +896,7 @@ module mano-types
           type string;
         }
       }
+
     }
   }
 
@@ -823,47 +928,76 @@ module mano-types
         }
       }
 
-      leaf cpu-pinning-policy {
-        description
-            "CPU pinning policy describes association
-             between virtual CPUs in guest and the
-             physical CPUs in the host.
-             DEDICATED : Virtual CPUs are pinned to
-                         physical CPUs
-             SHARED    : Multiple VMs may share the
-                         same physical CPUs.
-             ANY       : Any policy is acceptable for the VM";
-        type enumeration {
-          enum DEDICATED;
-          enum SHARED;
-          enum ANY;
+      choice cpu-policy {
+        case cpu-pinning {
+          leaf cpu-pinning-policy {
+            description
+                "CPU pinning policy describes association
+                 between virtual CPUs in guest and the
+                 physical CPUs in the host.
+                 DEDICATED : Virtual CPUs are pinned to
+                             physical CPUs
+                 SHARED    : Multiple VMs may share the
+                             same physical CPUs.
+                 ANY       : Any policy is acceptable for the VM";
+            type enumeration {
+              enum DEDICATED;
+              enum SHARED;
+              enum ANY;
+            }
+            default "ANY";
+          }
+          leaf cpu-thread-pinning-policy {
+              description
+                "CPU thread pinning policy describes how to
+                 place the guest CPUs when the host supports
+                 hyper threads:
+                 AVOID   : Avoids placing a guest on a host
+                           with threads.
+                 SEPARATE: Places vCPUs on separate cores,
+                           and avoids placing two vCPUs on
+                           two threads of same core.
+                 ISOLATE : Places each vCPU on a different core,
+                           and places no vCPUs from a different
+                           guest on the same core.
+                 PREFER  : Attempts to place vCPUs on threads
+                           of the same core.";
+            type enumeration {
+              enum AVOID;
+              enum SEPARATE;
+              enum ISOLATE;
+              enum PREFER;
+            }
+          }
         }
-        default "ANY";
-      }
 
-      leaf cpu-thread-pinning-policy {
-          description
-            "CPU thread pinning policy describes how to
-             place the guest CPUs when the host supports
-             hyper threads:
-             AVOID   : Avoids placing a guest on a host
-                       with threads.
-             SEPARATE: Places vCPUs on separate cores,
-                       and avoids placing two vCPUs on
-                       two threads of same core.
-             ISOLATE : Places each vCPU on a different core,
-                       and places no vCPUs from a different
-                       guest on the same core.
-             PREFER  : Attempts to place vCPUs on threads
-                       of the same core.";
-        type enumeration {
-          enum AVOID;
-          enum SEPARATE;
-          enum ISOLATE;
-          enum PREFER;
+        case cpu-quota {
+          container cpu-quota {
+              description "CPU quota describes the CPU resource allocation policy.
+                           Limit and Reserve values are defined in MHz";
+              uses allocation-properties;
+          }
         }
       }
 
+      container mem-quota {
+          description "Memory quota describes the memory resource allocation policy.
+                       Limit and Reserve values are defined in MB";
+          uses allocation-properties;
+      }
+
+      container disk-io-quota {
+          description "Disk IO quota describes the disk IO operations resource allocation policy.
+                       Limit and Reserve values are defined in IOPS";
+          uses allocation-properties;
+      }
+
+      container vif-quota {
+          description "Virtual interfaces quota describes the virtual interface bandwidth resource allocation policy.
+                       Limit and Reserve values are defined in Mbps";
+          uses allocation-properties;
+      }
+
       list pcie-device {
         description
             "List of pcie passthrough devices.";
@@ -998,6 +1132,27 @@ module mano-types
     }
   }
 
+  grouping allocation-properties {
+    leaf limit {
+      description "Defines the maximum allocation. The value 0 indicates that usage is not limited.
+                   This parameter ensures that the instance never uses more than the defined amount of resource.";
+      type uint64;
+    }
+
+    leaf reserve {
+      description "Defines the guaranteed minimum reservation.
+                   If needed, the machine will definitely get allocated the reserved amount of resources.";
+      type uint64;
+    }
+
+    leaf shares {
+      description "Number of shares allocated.
+                   Specifies the proportional weighted share for the domain.
+                   If this element is omitted, the service defaults to the OS provided defaults";
+      type uint64;
+    }
+  }
+
   grouping provider-network {
     container provider-network {
       description "Container for the provider network.";
@@ -1016,109 +1171,7 @@ module mano-types
     }
   }
 
-  grouping 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;
-      }
-
-      list parameter-group {
-        description
-            "Grouping of parameters which are logically grouped in UI";
-        key "name";
-
-        leaf name {
-          description
-              "Name of the parameter group";
-          type string;
-        }
-
-        list parameter {
-          description
-              "List of parameters for the service primitive.";
-          key "name";
-          uses manotypes:primitive-parameter;
-        }
-
-        leaf mandatory {
-          description "Is this parameter group mandatory";
-          type boolean;
-          default true;
-        }
-      }
-
-      list vnf-primitive-group {
-        description
-            "List of service primitives grouped by VNF.";
-
-        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 resolved 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;
-      }
-    }
-  }
-
-  grouping monitoring-param {
+  grouping http-endpoints {
     list http-endpoint {
       description
           "List of http endpoints to be used by monitoring params";
@@ -1179,52 +1232,16 @@ module mano-types
         }
       }
     }
-
-    list monitoring-param {
-      description
-          "List of monitoring parameters at the network service level";
-      key id;
-      leaf id {
-        type string;
-      }
-
-      leaf name {
-        type string;
-      }
-
-      leaf http-endpoint-ref {
-        type leafref {
-          path "../../http-endpoint/path";
-        }
-      }
-
-      leaf json-query-method {
-        type json-query-method;
-        default "NAMEKEY";
-      }
-
-      container json-query-params {
-        leaf json-path {
-          description
-            "The jsonpath to use to extract value from JSON structure";
-          type string;
-        }
-        leaf object-path {
-          description
-            "The objectpath to use to extract value from JSON structure";
-          type string;
-        }
-      }
-
-      uses monitoring-param-ui-data;
-      uses monitoring-param-value;
-
-    }
   }
 
   grouping monitoring-param-aggregation {
     typedef aggregation-type {
-      description "aggregation-type";
+      description
+          "aggregation-type, indicates the way to aggregate monitoring-params
+          (e.g. how to aggregate CPU utilisation of all VNFs belonging to the
+          same VNF group identified by member-vnf-index; or how to aggregate
+          memory utilisation of all VDUs belonging to the same VDU group
+          identified by vdu id)";
       type enumeration {
         enum AVERAGE;
         enum MINIMUM;
@@ -1730,11 +1747,12 @@ module mano-types
     }
   }
 
-  typedef alarm-operation-type {
+  typedef relational-operation-type {
     description
-        "The relational operator used to define whether an alarm
-        should be triggered in certain scenarios, such as if the
-        metric statistic goes above or below a specified value.";
+        "The relational operator used to define whether an alarm,
+        scaling event, etc. should be triggered in certain scenarios,
+        such as if the metric statistic goes above or below a specified
+        value.";
     type enumeration {
       enum GE; // greater than or equal
       enum LE; // less than or equal
@@ -1744,14 +1762,7 @@ module mano-types
     }
   }
 
-  grouping alarm {
-    leaf alarm-id {
-      description
-          "This field is reserved for the identifier assigned by the VIM provider";
-
-      type string;
-    }
-
+  grouping alarm-properties {
     leaf name {
       description "A human readable string to identify the alarm";
       type string;
@@ -1814,11 +1825,6 @@ module mano-types
       type alarm-severity-type;
     }
 
-    leaf metric {
-      description "The metric to be tracked by this alarm.";
-      type alarm-metric-type;
-    }
-
     leaf statistic {
       description "The type of metric statistic that is tracked by this alarm";
       type alarm-statistic-type;
@@ -1829,7 +1835,7 @@ module mano-types
           "The relational operator used to define whether an alarm should be
            triggered in certain scenarios, such as if the metric statistic
            goes above or below a specified value.";
-      type alarm-operation-type;
+      type relational-operation-type;
     }
 
     leaf value {
@@ -2120,7 +2126,7 @@ module mano-types
   grouping supplemental-boot-data {
     description "Grouping for custom vim data";
     container supplemental-boot-data {
-      uses manotypes:config-file;
+//    uses manotypes:config-file;
       leaf boot-data-drive {
         description "Some VIMs implement additional drives to host config-files or meta-data";
         type boolean;
@@ -2188,7 +2194,7 @@ module mano-types
       description
         "Project to which this belongs";
       type leafref {
-        path "/rw-project:project/rw-project:name";
+        path "/osm-project:project/osm-project:name";
       }
     }
   }