PEL:  Document support for sys based severities

Update the PEL message registry JSON schema and readme to support PEL
severity values that can depend on the system type.

For example:
    "Severity":
    [
        {
            "System": "systemA",
            "SevValue": "predictive"
        },
        {
            "System": "systemB",
            "SevValue": "recovered"
        },
        {
            "SevValue": "unrecoverable"
        }
    ]

On system systemA, the severity is predictive.
On system systemB, it is recovered.
On any other system it is unrecoverable.

The original method is still valid, like:
    "Severity": "recovered"

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ie1abae8f7a1dc55daec86ee86b4c1c4f7b83b19b
diff --git a/extensions/openpower-pels/registry/README.md b/extensions/openpower-pels/registry/README.md
index 73be98f..5ee3152 100644
--- a/extensions/openpower-pels/registry/README.md
+++ b/extensions/openpower-pels/registry/README.md
@@ -56,13 +56,33 @@
 the PEL severity.  It is an optional field, if it isn't specified, then the
 severity of the OpenBMC event log will be converted into a PEL severity value.
 
+It can either be the plain severity value, or an array of severity values that
+are based on system type, where an entry without a system type will match
+anything unless another entry has a matching system type.
+
 ```
 "Severity": "unrecoverable"
 ```
 
+```
+Severity":
+[
+    {
+        "System": "system1",
+        "SevValue": "recovered"
+    },
+    {
+        "Severity": "unrecoverable"
+    }
+]
+```
+The above example shows that on system 'system1' the severity will be
+recovered, and on every other system it will be unrecoverable.
+
 ### Mfg Severity
 This is an optional field and is used to override the Severity field when a
-specific manufacturing isolation mode is enabled.
+specific manufacturing isolation mode is enabled.  It has the same format as
+Severity.
 
 ```
 "MfgSeverity": "unrecoverable"
diff --git a/extensions/openpower-pels/registry/schema/schema.json b/extensions/openpower-pels/registry/schema/schema.json
index 40c7849..b3a7df6 100644
--- a/extensions/openpower-pels/registry/schema/schema.json
+++ b/extensions/openpower-pels/registry/schema/schema.json
@@ -195,9 +195,58 @@
                      "user_error", "corrosion"]
         },
 
+        "systemAndSeverity":
+        {
+            "description": "A severity entry that has an optional system type qualifier.  Used when the severity needs to be based on the system type.",
+            "type": "object",
+            "properties":
+            {
+                "System": { "$ref": "#/definitions/system" },
+                "SevValue": { "$ref": "#/definitions/severityTypes" }
+            },
+            "additionalProperties": false,
+            "required": ["SevValue"]
+        },
+
         "severity":
         {
-            "description": "PEL severity enumeration.  Optional.  If not provided, will use the event log severity.  See the PEL spec for more detailed definitions.",
+            "description": "PEL severity field.  Optional.  If not provided, it will use the event log severity. It can either be an enum of the severity value, or an array of them that is based on system type, where an entry without a system type acts as the catch all.",
+            "oneOf":
+            [
+                {
+                    "$ref": "#/definitions/severityTypes"
+                },
+                {
+                    "type": "array",
+                    "items":
+                    {
+                        "$ref": "#/definitions/systemAndSeverity"
+                    },
+                    "minItems": 1,
+                    "uniqueItems": true
+                }
+            ],
+
+            "examples":
+            [
+                "unrecoverable",
+
+                [
+                    {
+                        "System": "systemA",
+                        "SevValue": "predictive"
+                    },
+                    {
+                        "SevValue": "unrecoverable"
+                    }
+                ]
+            ]
+
+        },
+
+        "severityTypes":
+        {
+            "description": "PEL severity enumeration.  See the PEL spec for more detailed definitions.",
             "type": "string",
 
             "enum": ["non_error",
@@ -488,7 +537,8 @@
         "system":
         {
             "description": "The system type string, as specified by entity manger.  It is used to index into different sections of the JSON.",
-            "type": "string"
+            "type": "string",
+            "minLength": 1
         },
 
         "callouts":