{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "start": { "type": "string", "format": "date-time" }, "end": { "type": "string", "format": "date-time" }, "resolution": { "type": [ "number", "null" ] }, "aggregation": { "oneOf": [ { "oneOf": [ { "type": "string", "enum": [ "FIRST", "LAST", "COUNT", "MAX", "MIN", "MEDIAN", "MEAN", "SUM", "STD_DEV" ] }, { "type": "string", "enum": [ "NONE" ] } ] }, { "type": "object", "properties": { "type": { "oneOf": [ { "type": "string", "enum": [ "FIRST", "LAST", "COUNT", "MAX", "MIN", "MEDIAN", "MEAN", "SUM", "STD_DEV" ] }, { "type": "string", "enum": [ "NONE" ] } ] }, "options": { "type": "object", "additionalProperties": false } }, "additionalProperties": false, "required": [ "type" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "TIMEATVALUE" ] }, "options": { "type": "object", "properties": { "value": { "oneOf": [ { "type": "string", "maxLength": 255 }, { "type": "number" }, { "type": "boolean" } ] } }, "additionalProperties": false, "required": [ "value" ] } }, "additionalProperties": false, "required": [ "type", "options" ] } ] }, "limit": { "type": [ "number", "null" ] }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "devices": { "type": "object", "patternProperties": { "^[A-Fa-f\\d]{24}$": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "tags": { "type": "object", "patternProperties": { "^[0-9a-zA-Z_-]{1,255}$": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 255 } } }, "additionalProperties": false }, "points": { "type": "array", "items": { "type": "object", "properties": { "time": { "type": "string", "format": "date-time" }, "data": { "type": "object", "patternProperties": { "^[0-9a-zA-Z_-]{1,255}$": { "type": [ "number", "string", "boolean" ] } }, "additionalProperties": false } }, "additionalProperties": false, "required": [ "data", "time" ] } } }, "additionalProperties": false, "required": [ "name", "points", "tags" ] } }, "additionalProperties": false } }, "additionalProperties": false, "required": [ "start", "end", "resolution", "aggregation", "limit", "order", "devices" ] }