{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://example.com/schemas/hosts.schema.json", "title": "Hosts and Hostgroups", "type": "object", "additionalProperties": false, "properties": { "hosts": { "type": "array", "items": { "$ref": "#/$defs/Host" } }, "hostgroups": { "type": "array", "items": { "$ref": "#/$defs/HostGroup" } } }, "required": ["hosts"], "$defs": { "Host": { "type": "object", "additionalProperties": false, "properties": { "hostname": { "type": "string", "pattern": "^[A-Za-z0-9._-]+$" }, "type": { "type": "string" }, "model": { "type": "string" }, "max_slot": { "type": "integer", "minimum": -1, "description": "-1 means auto-detect" }, "dispatch_window": { "type": "array", "items": { "$ref": "#/$defs/TimeWindow" } }, "sched_stop": { "type": "array", "items": { "$ref": "#/$defs/SchedStop" } }, "resource": { "type": "array", "items": { "$ref": "#/$defs/HostResource" } }, "description": { "type": "string", "maxLength": 4096 } }, "required": ["hostname"] }, "HostResource": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string", "pattern": "^[A-Za-z0-9._-]+$" }, "value": { "description": "Resource value (string or number)", "oneOf": [ { "type": "number" }, { "type": "string" } ] } }, "required": ["name"] }, "TimeWindow": { "type": "object", "additionalProperties": false, "properties": { "start_time": { "type": "string", "description": "[day:]hour[:minute]; day 0-6, hour 0-23, minute 0-59", "pattern": "^((([0-6]):)?([01]?\\d|2[0-3])(:[0-5]?\\d)?)$" }, "end_time": { "type": "string", "description": "[day:]hour[:minute]; day 0-6, hour 0-23, minute 0-59", "pattern": "^((([0-6]):)?([01]?\\d|2[0-3])(:[0-5]?\\d)?)$" } }, "required": ["start_time", "end_time"] }, "SchedStop": { "type": "object", "additionalProperties": false, "properties": { "resname": { "type": "string" }, "sched": { "type": "number" }, "stop": { "type": "number" } }, "required": ["resname"], "anyOf": [ { "required": ["sched"] }, { "required": ["stop"] } ] }, "HostGroup": { "type": "object", "additionalProperties": false, "properties": { "groupname": { "type": "string", "pattern": "^[A-Za-z0-9._-]+$" }, "members": { "type": "array", "minItems": 1, "items": { "type": "string", "pattern": "^(?:all|!|[A-Za-z0-9._*\\[\\]-]+)$" } }, "exclude_members": { "type": "array", "items": { "type": "string", "pattern": "^(?:all|!|[A-Za-z0-9._*\\[\\]-]+)$" } } }, "required": ["groupname", "members"] } } }