Add scaling augment
[osm/IM.git] / augments / common-augments.yang
index 3b2b51f..7beec89 100644 (file)
@@ -152,7 +152,7 @@ module common-augments {
                 type string;
             }
         }
-    } 
+    }
 
     grouping configuration-method {
         choice config-method {
@@ -315,4 +315,240 @@ module common-augments {
         }
         uses common:vnfc-metrics;
     }
-}
+
+    typedef alarm-severity-type {
+        description
+          "An indication of the importance or urgency of the alarm";
+        type enumeration {
+            enum LOW;
+            enum MODERATE;
+            enum CRITICAL;
+        }
+    }
+
+    typedef alarm-statistic-type {
+        description
+          "Statistic type to use to determine threshold crossing
+           for an alarm.";
+        type enumeration {
+            enum AVERAGE;
+            enum MINIMUM;
+            enum MAXIMUM;
+            enum COUNT;
+            enum SUM;
+        }
+    }
+
+    typedef relational-operation-type {
+        description
+          "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
+            enum GT; // greater than
+            enum LT; // less than
+            enum EQ; // equal
+        }
+    }
+
+    grouping alarm-properties {
+        leaf name {
+            description
+              "A human readable string to identify the alarm";
+            type string;
+        }
+
+        leaf description {
+            description
+              "A description of this alarm";
+            type string;
+        }
+
+        leaf vdur-id {
+            description
+              "The identifier of the VDUR that the alarm is associated with";
+            type string;
+        }
+
+        container actions {
+            list ok {
+                key "url";
+                leaf url {
+                    type string;
+                }
+            }
+
+            list insufficient-data {
+                key "url";
+                leaf url {
+                    type string;
+                }
+            }
+
+            list alarm {
+                key "url";
+                leaf url {
+                    type string;
+                }
+            }
+        }
+
+        leaf repeat {
+            description
+              "This flag indicates whether the alarm should be repeatedly emitted
+               while the associated threshold has been crossed.";
+
+            type boolean;
+            default true;
+        }
+
+        leaf enabled {
+            description
+              "This flag indicates whether the alarm has been enabled or
+               disabled.";
+
+            type boolean;
+            default true;
+        }
+
+        leaf severity {
+            description
+              "A measure of the importance or urgency of the alarm";
+            type alarm-severity-type;
+        }
+
+        leaf statistic {
+            description
+              "The type of metric statistic that is tracked by this alarm";
+            type alarm-statistic-type;
+        }
+
+        leaf operation {
+            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.";
+            type relational-operation-type;
+        }
+
+        leaf value {
+            description
+              "This value defines the threshold that, if crossed, will trigger
+               the alarm.";
+            type decimal64 {
+                fraction-digits 4;
+            }
+        }
+
+        leaf period {
+            description
+              "The period defines the length of time (seconds) that the metric
+               data are collected over in oreder to evaluate the chosen
+               statistic.";
+            type uint32;
+        }
+
+        leaf evaluations {
+            description
+              "Defines the length of time (seconds) in which metric data are
+               collected in order to evaluate the chosen statistic.";
+            type uint32;
+        }
+    }
+
+    grouping virtual-interface {
+        container virtual-interface {
+            description
+              "Container for the virtual interface properties";
+
+            leaf type {
+                description
+                  "Specifies the type of virtual interface
+                   between VM and host.
+                   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.
+                   E1000           : Emulate E1000 interface.
+                   RTL8139         : Emulate RTL8139 interface.
+                   PCNET           : Emulate PCNET interface.
+                   OM-MGMT         : Deprecated! Use PARAVIRT instead and set the VNF management interface at vnfd:mgmt-interface:cp";
+
+                type enumeration {
+                    enum PARAVIRT;
+                    enum OM-MGMT;
+                    enum PCI-PASSTHROUGH;
+                    enum SR-IOV;
+                    enum VIRTIO;
+                    enum E1000;
+                    enum RTL8139;
+                    enum PCNET;
+                }
+                default "PARAVIRT";
+            }
+
+            leaf vpci {
+                description
+                  "Specifies the virtual PCI address. Expressed in
+                   the following format dddd:dd:dd.d. For example
+                   0000:00:12.0. This information can be used to
+                   pass as metadata during the VM creation.";
+                type string;
+            }
+
+            leaf bandwidth {
+                description
+                  "Aggregate bandwidth of the NIC.";
+                type uint64;
+            }
+        }
+    }
+
+    grouping description {
+        leaf description {
+            type string;
+        }
+    }
+
+    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;
+            }
+        }
+    }
+}
\ No newline at end of file