-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.schema.json
More file actions
122 lines (122 loc) · 4.61 KB
/
config.schema.json
File metadata and controls
122 lines (122 loc) · 4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{
"$schema": "https://json-schema.org/draft-07/schema#",
"$id": "https://thingconnect.io/pulse/config.schema.json",
"title": "ThingConnect Pulse Config",
"type": "object",
"additionalProperties": false,
"required": ["version", "defaults", "groups", "targets"],
"properties": {
"version": { "type": ["integer", "string"], "enum": [1, "1"] },
"defaults": {
"type": "object",
"additionalProperties": false,
"properties": {
"interval_seconds": { "type": ["integer", "string"], "minimum": 1, "default": 10 },
"timeout_ms": { "type": ["integer", "string"], "minimum": 100, "default": 1500 },
"retries": { "type": ["integer", "string"], "minimum": 0, "default": 1 },
"http": {
"type": "object",
"additionalProperties": false,
"properties": {
"user_agent": { "type": "string", "default": "ThingConnectPulse/1.0" },
"expect_text": { "type": "string", "default": "" }
},
"default": {}
}
},
"required": ["interval_seconds", "timeout_ms", "retries"]
},
"groups": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["id", "name"],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$"
},
"name": { "type": "string", "minLength": 1 },
"parent_id": { "type": ["string", "null"] },
"color": { "type": "string", "pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$" },
"sort_order": { "type": ["integer", "string"] }
},
"additionalProperties": false
}
},
"targets": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#/definitions/target" }
}
},
"definitions": {
"hostname": {
"type": "string",
"pattern": "^(?=.{1,253}$)(?!-)[A-Za-z0-9-]{1,63}(?<!-)(\\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*\\.?$"
},
"ipv4": {
"type": "string",
"pattern": "^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$"
},
"ipv6": {
"type": "string",
"pattern": "^[0-9A-Fa-f:]+$"
},
"cidr": {
"type": "string",
"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]))$"
},
"wildcard": {
"type": "string",
"description": "IPv4 wildcard like 10.10.1.* (expands 1..254 by default)",
"pattern": "^(?:(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)\\.){3}\\*$"
},
"probeType": { "enum": ["icmp", "tcp", "http"] },
"target": {
"type": "object",
"required": ["type", "group"],
"properties": {
"type": { "$ref": "#/definitions/probeType" },
"group": { "type": "string" },
"name": { "type": ["string", "null"] },
"host": { "type": ["string", "null"] },
"cidr": { "type": ["string", "null"] },
"wildcard": { "type": ["string", "null"] },
"port": { "type": ["integer", "string", "null"], "minimum": 1, "maximum": 65535 },
"http_path": { "type": ["string", "null"] },
"http_match": { "type": ["string", "null"] },
"interval_seconds": { "type": ["integer", "string", "null"], "minimum": 1 },
"timeout_ms": { "type": ["integer", "string", "null"], "minimum": 100 },
"retries": { "type": ["integer", "string", "null"], "minimum": 0 },
"expected_rtt_ms": { "type": ["integer", "string", "null"], "minimum": 1 },
"enabled": { "type": ["boolean", "null"] },
"notes": { "type": ["string", "null"] }
},
"anyOf": [
{ "required": ["host"] },
{ "required": ["cidr"] },
{ "required": ["wildcard"] }
],
"allOf": [
{
"if": { "properties": { "type": { "const": "tcp" } } },
"then": { "required": ["port"] }
}
]
}
},
"examples": [
{
"version": 1,
"defaults": { "interval_seconds": 10, "timeout_ms": 1500, "retries": 1, "http": { "user_agent": "ThingConnectPulse/1.0", "expect_text": "" } },
"groups": [ { "id": "new-press", "name": "Press Shop" }, { "id": "new-lab", "name": "Quality Lab" } ],
"targets": [
{ "type": "icmp", "host": "10.10.1.21", "name": "PLC-Press-01", "group": "press", "interval_seconds": 5 },
{ "type": "tcp", "wildcard": "10.10.1.*", "port": 5900, "name": "HMI-VNC", "group": "press" },
{ "type": "http", "cidr": "10.10.2.0/28", "http_path": "/health", "http_match": "OK", "name": "QMS-HTTP", "group": "lab" }
]
}
]
}