schema: Add virtual sensor schema

This schema allows entity manager to define virtual sensors that are
used by the virtual-sensor daemon from the phosphor-virtual-sensor
repository.

Currently only a modified median of sensor values is accepted by
phosphor-virtual-sensor.

Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I510dbcd843f703073a96ad33cfe748d0dcd21e64
diff --git a/schemas/VirtualSensor.json b/schemas/VirtualSensor.json
new file mode 100644
index 0000000..391f695
--- /dev/null
+++ b/schemas/VirtualSensor.json
@@ -0,0 +1,83 @@
+{
+    "$schema": "http://json-schema.org/draft-07/schema#",
+    "definitions": {
+        "VirtualSensor": {
+            "title": "phosphor-virtual-sensor configuration",
+            "description": [
+                "The configuration used by the virtual-sensor daemon",
+                "in the phosphor-virtual-sensor repository. Virtual",
+                "sensors are xyz.openbmc_project.Sensor.Value D-Bus",
+                "objects that have sensor values calculated from the",
+                "D-Bus sensors listed here."
+            ],
+            "type": "object",
+            "properties": {
+                "MaxValidInput": {
+                    "description": [
+                        "Maximum valid value of an input sensor"
+                    ],
+                    "type": "number"
+                },
+                "MaxValue": {
+                    "description": [
+                        "Maximum sensor value"
+                    ],
+                    "$ref": "legacy.json#/definitions/Types/MaxValue"
+                },
+                "MinValidInput": {
+                    "description": [
+                        "Miniumum valid value of an input sensor"
+                    ],
+                    "type": "number"
+                },
+                "MinValue": {
+                    "description": [
+                        "Minimum sensor value"
+                    ],
+                    "$ref": "legacy.json#/definitions/Types/MinValue"
+                },
+                "Name": {
+                    "type": "string"
+                },
+                "Sensors": {
+                    "description": [
+                        "Any DBus sensors whose values are used to",
+                        "determine the value of the virtual sensor."
+                    ],
+                    "items": {
+                        "type": "string"
+                    },
+                    "type": "array"
+                },
+                "Thresholds": {
+                    "description": [
+                        "Threshold values used to set and clear alarms"
+                    ],
+                    "$ref": "legacy.json#/definitions/Types/Thresholds"
+                },
+                "Type": {
+                    "description": [
+                        "The type of calculation this sensor uses."
+                    ],
+                    "type": "string",
+                    "enum": [
+                        "ModifiedMedian"
+                    ]
+                },
+                "Units": {
+                    "description": [
+                        "The sensor type, as it shows up in the D-Bus",
+                        "object name."
+                    ],
+                    "$ref": "legacy.json#/definitions/Types/Units"
+                }
+            },
+            "required": [
+                "Name",
+                "Sensors",
+                "Type",
+                "Units"
+            ]
+        }
+    }
+}