Support for additional EPA parameters for resource allocation and placement
[osm/IM.git] / models / yang / mano-types.yang
index 81022ad..dbf2ba2 100644 (file)
@@ -27,10 +27,6 @@ module mano-types
     prefix "inet";
   }
 
-  import rw-pb-ext {
-    prefix "rwpb";
-  }
-
   import rw-project {
     prefix "rw-project";
   }
@@ -82,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.";
@@ -195,7 +197,7 @@ module mano-types
       }
     }
   }
-  
+
  grouping image-properties {
     leaf image {
       description
@@ -241,6 +243,19 @@ module mano-types
     }
   }
 
+  grouping vca-metrics {
+    description
+        "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 vca-configuration {
     description
@@ -277,70 +292,74 @@ module mano-types
             description "Juju charm to use with the VNF or VDU.";
             type string;
           }
+          leaf proxy {
+            description "Is this a proxy charm?";
+            type boolean;
+            default true;
+          }
           uses manotypes:vca-relationships;
-
         }
       }
+    }
+
+    list config-primitive {
+      description
+        "List of config primitives supported by the
+        configuration agent for this VNF or VDU.";
+      key "name";
 
+      leaf name {
+        description
+          "Name of the config primitive.";
+        type string;
+      }
 
-      list service-primitive {
-        rwpb:msg-new ServicePrimitive;
+      list parameter {
         description
-          "List of config primitives supported by the
-          configuration agent for this VNF or VDU.";
+          "List of parameters to the config primitive.";
         key "name";
+        uses primitive-parameter;
+      }
 
-        leaf name {
-          description
-            "Name of the config primitive.";
-          type string;
-        }
-
-        list parameter {
-          description
-            "List of parameters to the config primitive.";
-          key "name";
-          uses primitive-parameter;
-        }
-
-        leaf user-defined-script {
-          description
-            "A user defined script. If user defined script is defined,
-             the script will be executed using bash";
-          type string;
-        }
+      leaf user-defined-script {
+        description
+          "A user defined script. If user defined script is defined,
+           the script will be executed using bash";
+        type string;
       }
+    }
 
-      list initial-config-primitive {
-        rwpb:msg-new InitialConfigPrimitive;
+    list initial-config-primitive {
+      description
+        "Initial set of configuration primitives.";
+      key "seq";
+      leaf seq {
         description
-          "Initial set of configuration primitives.";
-        key "seq";
-        leaf seq {
-          description
-              "Sequence number for the configuration primitive.";
-          type uint64;
-        }
+          "Sequence number for the configuration primitive.";
+        type uint64;
+      }
 
-        choice primitive-type {
-          case primitive-definition {
-            leaf name {
-              description
-                "Name of the configuration primitive.";
-              type string;
-            }
+      choice primitive-type {
+        case primitive-definition {
+          leaf name {
+            description
+              "Name of the configuration primitive.";
+            type string;
+          }
 
-            uses primitive-parameter-value;
+          uses primitive-parameter-value;
 
-            leaf user-defined-script {
-              description
-                "A user defined script.";
-              type string;
-            }
+          leaf user-defined-script {
+            description
+              "A user defined script.";
+            type string;
           }
         }
       }
     }
+
+    uses manotypes:vca-metrics;
+
   } // END - grouping vca-configuration
 
   typedef virtual-link-type {
@@ -626,6 +645,60 @@ 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_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 {
@@ -648,12 +721,12 @@ module mano-types
     }
   } //grouping vm-flavor
 
-       grouping vm-flavor-name {
-       leaf vm-flavor-name {
-               description "flavor name to be used while creating vm using cloud account";
-               type string;
-       }
-       }
+  grouping vm-flavor-name {
+    leaf vm-flavor-name {
+      description "flavor name to be used while creating vm using cloud account";
+      type string;
+    }
+  }
 
   grouping vswitch-epa {
     container vswitch-epa {
@@ -782,7 +855,6 @@ module mano-types
         }
       }
 
-
       leaf om-cpu-model-string {
         description "OpenMANO CPU model string";
         type string;
@@ -796,6 +868,7 @@ module mano-types
           type string;
         }
       }
+
     }
   }
 
@@ -827,47 +900,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.";
@@ -1002,6 +1104,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.";
@@ -1074,7 +1197,7 @@ module mano-types
         leaf member-vnf-index-ref {
           description
               "Reference to member-vnf within constituent-vnfds";
-          type uint64;
+          type string;
         }
 
         leaf vnfd-id-ref {
@@ -1122,7 +1245,7 @@ module mano-types
     }
   }
 
-  grouping monitoring-param {
+  grouping http-endpoints {
     list http-endpoint {
       description
           "List of http endpoints to be used by monitoring params";
@@ -1183,52 +1306,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;
@@ -1734,11 +1821,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
@@ -1833,7 +1921,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 {
@@ -1959,7 +2047,6 @@ module mano-types
     }
 
     list user {
-      rwpb:msg-new CloudConfigUser;
       key "name";
       description "List of users to be added through cloud-config";
 
@@ -2125,7 +2212,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;