leak detector: json schema definition
Define the json schema for leak detector and use it in expose elements
in global.json schema. The leak detector schema defines various
properties such as type, subtype, gpio pin name, gpio polarity, etc as
per design https://gerrit.openbmc.org/c/openbmc/docs/+/73152.
Related PR:
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/75999
Change-Id: I82f674a982d57774f3616cf0064256f8feadf158
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/schemas/leak_detector.json b/schemas/leak_detector.json
new file mode 100644
index 0000000..d37531a
--- /dev/null
+++ b/schemas/leak_detector.json
@@ -0,0 +1,43 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "$defs": {
+ "GPIOLeakDetector": {
+ "description": "Configuration for GPIO based Leak Detector.",
+ "type": "object",
+ "properties": {
+ "Name": {
+ "description": "The name of the leak detector.",
+ "type": "string"
+ },
+ "Type": {
+ "description": "The type of configuration object",
+ "type": "string"
+ },
+ "SubType": {
+ "description": "The type of leak detector.",
+ "enum": ["LeakSensingCable", "Unknown"]
+ },
+ "PinName": {
+ "description": "The GPIO pin name for the leak detector.",
+ "type": "string"
+ },
+ "Polarity": {
+ "description": "The GPIO polarity depicting its active status.",
+ "enum": ["ActiveLow", "ActiveHigh"]
+ },
+ "Level": {
+ "description": "The severity level of the leak detector.",
+ "enum": ["Critical", "Warning"]
+ }
+ },
+ "required": [
+ "Name",
+ "Type",
+ "SubType",
+ "PinName",
+ "Polarity",
+ "Level"
+ ]
+ }
+ }
+}