|
6 | 6 | "additionalProperties": false, |
7 | 7 | "required": ["version", "defaults", "groups", "targets"], |
8 | 8 | "properties": { |
9 | | - "version": { "type": "integer", "const": 1 }, |
| 9 | + "version": { "type": ["integer", "string"], "enum": [1, "1"] }, |
10 | 10 | "defaults": { |
11 | 11 | "type": "object", |
12 | 12 | "additionalProperties": false, |
13 | 13 | "properties": { |
14 | | - "interval_seconds": { "type": "integer", "minimum": 1, "default": 10 }, |
15 | | - "timeout_ms": { "type": "integer", "minimum": 100, "default": 1500 }, |
16 | | - "retries": { "type": "integer", "minimum": 0, "default": 1 }, |
| 14 | + "interval_seconds": { "type": ["integer", "string"], "minimum": 1, "default": 10 }, |
| 15 | + "timeout_ms": { "type": ["integer", "string"], "minimum": 100, "default": 1500 }, |
| 16 | + "retries": { "type": ["integer", "string"], "minimum": 0, "default": 1 }, |
17 | 17 | "http": { |
18 | 18 | "type": "object", |
19 | 19 | "additionalProperties": false, |
|
31 | 31 | "minItems": 1, |
32 | 32 | "items": { |
33 | 33 | "type": "object", |
34 | | - "additionalProperties": false, |
35 | 34 | "required": ["id", "name"], |
36 | 35 | "properties": { |
37 | 36 | "id": { |
38 | 37 | "type": "string", |
39 | 38 | "pattern": "^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$" |
40 | 39 | }, |
41 | 40 | "name": { "type": "string", "minLength": 1 }, |
42 | | - "parent_id": { "type": "string" }, |
| 41 | + "parent_id": { "type": ["string", "null"] }, |
43 | 42 | "color": { "type": "string", "pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$" }, |
44 | | - "sort_order": { "type": "integer" } |
45 | | - } |
| 43 | + "sort_order": { "type": ["integer", "string"] } |
| 44 | + }, |
| 45 | + "additionalProperties": false |
46 | 46 | } |
47 | 47 | }, |
48 | 48 | "targets": { |
|
58 | 58 | }, |
59 | 59 | "ipv4": { |
60 | 60 | "type": "string", |
61 | | - "pattern": "^(?:(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)$" |
| 61 | + "pattern": "^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$" |
62 | 62 | }, |
63 | 63 | "ipv6": { |
64 | 64 | "type": "string", |
65 | 65 | "pattern": "^[0-9A-Fa-f:]+$" |
66 | 66 | }, |
67 | 67 | "cidr": { |
68 | 68 | "type": "string", |
69 | | - "pattern": "^(?:((?:(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1?\\d?\\d))\\/(?:[0-9]|[12][0-9]|3[0-2]))|((?:[0-9A-Fa-f:]+)\\/(?:[0-9]|[1-9]\\d|1[01]\\d|12[0-8])))$" |
| 69 | + "pattern": "^(?:(?:(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)\\/(?:[0-9]|[12][0-9]|3[0-2]))|(?:(?:[0-9A-Fa-f:]+)\\/(?:[0-9]|[1-9]\\d|1[01]\\d|12[0-8]))$" |
70 | 70 | }, |
71 | 71 | "wildcard": { |
72 | 72 | "type": "string", |
73 | 73 | "description": "IPv4 wildcard like 10.10.1.* (expands 1..254 by default)", |
74 | 74 | "pattern": "^(?:(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)\\.){3}\\*$" |
75 | 75 | }, |
76 | 76 | "probeType": { "enum": ["icmp", "tcp", "http"] }, |
77 | | - "baseTarget": { |
| 77 | + "target": { |
78 | 78 | "type": "object", |
79 | | - "additionalProperties": false, |
80 | 79 | "required": ["type", "group"], |
81 | 80 | "properties": { |
82 | 81 | "type": { "$ref": "#/definitions/probeType" }, |
83 | 82 | "group": { "type": "string" }, |
84 | | - "name": { "type": "string" }, |
85 | | - "interval_seconds": { "type": "integer", "minimum": 1 }, |
86 | | - "timeout_ms": { "type": "integer", "minimum": 100 }, |
87 | | - "retries": { "type": "integer", "minimum": 0 }, |
88 | | - "expected_rtt_ms": { "type": "integer", "minimum": 1 }, |
89 | | - "enabled": { "type": "boolean", "default": true }, |
90 | | - "notes": { "type": "string" } |
91 | | - } |
92 | | - }, |
93 | | - "locationHost": { |
94 | | - "oneOf": [ |
95 | | - { "properties": { "host": { "oneOf": [ { "$ref": "#/definitions/hostname" }, { "$ref": "#/definitions/ipv4" }, { "$ref": "#/definitions/ipv6" } ] } }, "required": ["host"], "additionalProperties": true }, |
96 | | - { "properties": { "cidr": { "$ref": "#/definitions/cidr" } }, "required": ["cidr"], "additionalProperties": true }, |
97 | | - { "properties": { "wildcard": { "$ref": "#/definitions/wildcard" } }, "required": ["wildcard"], "additionalProperties": true } |
98 | | - ] |
99 | | - }, |
100 | | - "target": { |
| 83 | + "name": { "type": ["string", "null"] }, |
| 84 | + "host": { "type": ["string", "null"] }, |
| 85 | + "cidr": { "type": ["string", "null"] }, |
| 86 | + "wildcard": { "type": ["string", "null"] }, |
| 87 | + "port": { "type": ["integer", "string", "null"], "minimum": 1, "maximum": 65535 }, |
| 88 | + "http_path": { "type": ["string", "null"] }, |
| 89 | + "http_match": { "type": ["string", "null"] }, |
| 90 | + "interval_seconds": { "type": ["integer", "string", "null"], "minimum": 1 }, |
| 91 | + "timeout_ms": { "type": ["integer", "string", "null"], "minimum": 100 }, |
| 92 | + "retries": { "type": ["integer", "string", "null"], "minimum": 0 }, |
| 93 | + "expected_rtt_ms": { "type": ["integer", "string", "null"], "minimum": 1 }, |
| 94 | + "enabled": { "type": ["boolean", "null"] }, |
| 95 | + "notes": { "type": ["string", "null"] } |
| 96 | + }, |
| 97 | + "anyOf": [ |
| 98 | + { "required": ["host"] }, |
| 99 | + { "required": ["cidr"] }, |
| 100 | + { "required": ["wildcard"] } |
| 101 | + ], |
101 | 102 | "allOf": [ |
102 | | - { "$ref": "#/definitions/baseTarget" }, |
103 | | - { "$ref": "#/definitions/locationHost" }, |
104 | 103 | { |
105 | | - "type": "object", |
106 | | - "properties": { |
107 | | - "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, |
108 | | - "http_path": { "type": "string", "default": "/" }, |
109 | | - "http_match": { "type": "string" } |
110 | | - }, |
111 | | - "allOf": [ |
112 | | - { |
113 | | - "if": { "properties": { "type": { "const": "tcp" } } }, |
114 | | - "then": { "required": ["port"] } |
115 | | - }, |
116 | | - { |
117 | | - "if": { "properties": { "type": { "const": "http" } } }, |
118 | | - "then": { "properties": { "port": { "default": 80 }, "http_path": { "minLength": 1 } } } |
119 | | - } |
120 | | - ] |
| 104 | + "if": { "properties": { "type": { "const": "tcp" } } }, |
| 105 | + "then": { "required": ["port"] } |
121 | 106 | } |
122 | 107 | ] |
123 | 108 | } |
|
0 commit comments