Yang models for internal system health and fault aggregration. 75/19275/4
authorKeith Burns (alagalah) <alagalah@gmail.com>
Wed, 29 Apr 2015 04:07:19 +0000 (21:07 -0700)
committerThomas Bachman <tbachman@yahoo.com>
Thu, 28 May 2015 16:43:04 +0000 (12:43 -0400)
- Instrumentation, leveraging data store instead of log to generate sane log messages.

Change-Id: I5e7eafd8a7f527c77fd5f47b3bc41b65b8cd0ed5
Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
groupbasedpolicy/src/main/yang/operationalstate/fault-rule.yang [new file with mode: 0644]
groupbasedpolicy/src/main/yang/operationalstate/faults.yang [new file with mode: 0644]
groupbasedpolicy/src/main/yang/operationalstate/health-rule.yang [new file with mode: 0644]
groupbasedpolicy/src/main/yang/operationalstate/health.yang [new file with mode: 0644]

diff --git a/groupbasedpolicy/src/main/yang/operationalstate/fault-rule.yang b/groupbasedpolicy/src/main/yang/operationalstate/fault-rule.yang
new file mode 100644 (file)
index 0000000..d89f6ae
--- /dev/null
@@ -0,0 +1,16 @@
+// Contents of "fault-rule"
+module fault-rule {
+    namespace "urn:opendaylight:fault-rule";
+    prefix "fault-rule";
+
+    revision 2015-04-28 {
+        description "Initial revision";
+    }
+
+    typedef rule {type string;}
+
+    container fault-rules {
+        description "stuff";
+
+    }
+}
diff --git a/groupbasedpolicy/src/main/yang/operationalstate/faults.yang b/groupbasedpolicy/src/main/yang/operationalstate/faults.yang
new file mode 100644 (file)
index 0000000..302a57d
--- /dev/null
@@ -0,0 +1,96 @@
+// Contents of "fault-instance"
+module fault-instance {
+    namespace "urn:opendaylight:fault-instance";
+    prefix "fault-instance";
+
+    import gbp-common {prefix gbp-common;}
+    import ietf-inet-types {prefix inet;}
+    import ietf-yang-types {prefix yang;}
+    import fault-rule {prefix fault-rule;}
+
+    revision 2015-04-28 {
+        description "Initial revision";
+    }
+
+    typedef severity {
+            type enumeration {
+                enum emergency {
+                    description
+                                        "A panic condition";
+                }
+                enum alert {
+                    description
+                                        "Should be corrected immediately";
+                }
+                enum critical {
+                    description
+                                        "Should be corrected immediately";
+                }
+                enum error {
+                    description
+                                        "Non-urgent failure";
+                }
+                enum warning {
+                    description
+                                        "Indication that an error will occur if action is not taken";
+                }
+                enum informational {
+                    description
+                                        "Normal operational events";
+                }
+                enum trace {
+                    description
+                                        "System debug";
+                }
+            }
+    }
+
+    container faults {
+
+        list fault {
+            key "id";
+            leaf id {
+                description "A unique ID for the fault";
+                type gbp-common:unique-id;
+                mandatory true;
+
+            }
+            leaf cause {
+                description "A user-visible name for the tenant";
+                type gbp-common:description;
+            }
+            leaf description {
+                description "A user-readable description for the tenant";
+                type gbp-common:description;
+            }
+            leaf counter {
+                description "Occurences of this fault";
+                type yang:counter32;
+            }
+            leaf trigger {
+                type fault-rule:rule;
+            }
+            leaf created {
+                type yang:timestamp;
+            }
+            leaf modified {
+                type yang:timestamp;
+            }
+            leaf component {
+                description "his should be a leafref or a choice between leafref and description.
+                    This allows us to segment by tenant and component.";
+                type gbp-common:description;
+            }
+            leaf highest-severity {
+                type severity;
+            }
+            leaf current-severity {
+                type severity;
+            }
+            leaf previous-severity {
+                type severity;
+            }
+
+        }
+    }
+}
diff --git a/groupbasedpolicy/src/main/yang/operationalstate/health-rule.yang b/groupbasedpolicy/src/main/yang/operationalstate/health-rule.yang
new file mode 100644 (file)
index 0000000..bf27a15
--- /dev/null
@@ -0,0 +1,24 @@
+// Contents of "fault-rule"
+module health-rule {
+    namespace "urn:opendaylight:health-rule";
+    prefix "health-rule";
+
+    revision 2015-04-28 {
+        description "Initial revision";
+    }
+
+    typedef rule {type string;}
+
+    container health-rules {
+        description "Objective rule contructs for health score formula";
+
+    }
+
+    container health-score-faults {
+
+    }
+
+    container health-score {
+
+    }
+}
diff --git a/groupbasedpolicy/src/main/yang/operationalstate/health.yang b/groupbasedpolicy/src/main/yang/operationalstate/health.yang
new file mode 100644 (file)
index 0000000..3b92118
--- /dev/null
@@ -0,0 +1,93 @@
+module health {
+    namespace "urn:opendaylight:health";
+    prefix "health";
+
+    import gbp-common {prefix gbp-common;}
+    import ietf-inet-types {prefix inet;}
+    import ietf-yang-types {prefix yang;}
+    import fault-rule {prefix fault-rule;}
+
+    revision 2015-04-28 {
+        description "Initial revision";
+    }
+
+    typedef severity {
+            type enumeration {
+                enum emergency {
+                    description
+                                        "A panic condition";
+                }
+                enum alert {
+                    description
+                                        "Should be corrected immediately";
+                }
+                enum critical {
+                    description
+                                        "Should be corrected immediately";
+                }
+                enum error {
+                    description
+                                        "Non-urgent failure";
+                }
+                enum warning {
+                    description
+                                        "Indication that an error will occur if action is not taken";
+                }
+                enum informational {
+                    description
+                                        "Normal operational events";
+                }
+                enum trace {
+                    description
+                                        "System debug";
+                }
+            }
+    }
+
+    container faults {
+
+        list fault {
+            key "id";
+            leaf id {
+                description "A unique ID for the fault";
+                type gbp-common:unique-id;
+                mandatory true;
+
+            }
+            leaf cause {
+                description "A user-visible name for the tenant";
+                type gbp-common:description;
+            }
+            leaf description {
+                description "A user-readable description for the tenant";
+                type gbp-common:description;
+            }
+            leaf counter {
+                description "Occurences of this fault";
+                type yang:counter32;
+            }
+            leaf trigger {
+                type fault-rule:rule;
+            }
+            leaf created {
+                type yang:timestamp;
+            }
+            leaf modified {
+                type yang:timestamp;
+            }
+            leaf component {
+                type gbp-common:description;
+            }
+            leaf highest-severity {
+                type severity;
+            }
+            leaf current-severity {
+                type severity;
+            }
+            leaf previos-severity {
+                type severity;
+            }
+
+        }
+    }
+}