-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpingtrace.schema.json
More file actions
187 lines (187 loc) · 6.67 KB
/
pingtrace.schema.json
File metadata and controls
187 lines (187 loc) · 6.67 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/skhell/pingtrace/v1.0.0/schema/pingtrace.schema.json",
"title": "Pingtrace JSON Report",
"description": "Schema for the JSON document emitted by `pingtrace --json`. Supports two top-level shapes: the classic ping/trace report and the MTR final report, discriminated by the `mode` field.",
"type": "object",
"required": ["$schema", "pingtraceVersion", "generatedAt", "mode"],
"properties": {
"$schema": {
"type": "string",
"format": "uri",
"description": "URI of this schema. Allows tools to validate the document without prior knowledge."
},
"pingtraceVersion": {
"type": "string",
"description": "Semantic version of the pingtrace binary that produced the document."
},
"generatedAt": {
"type": "string",
"format": "date-time",
"description": "ISO-8601 UTC timestamp of when the document was produced."
},
"mode": {
"type": "string",
"enum": ["probe", "mtr"],
"description": "`probe` for ping/trace reports; `mtr` for the MTR final report."
}
},
"oneOf": [
{ "$ref": "#/$defs/ProbeReport" },
{ "$ref": "#/$defs/MtrReport" }
],
"$defs": {
"ProbeReport": {
"type": "object",
"required": ["mode", "targets", "results"],
"properties": {
"mode": { "const": "probe" },
"targets": {
"type": "array",
"items": { "$ref": "#/$defs/Target" }
},
"results": {
"type": "array",
"items": { "$ref": "#/$defs/ProbeResult" }
},
"exportedFiles": {
"type": "array",
"items": { "$ref": "#/$defs/ExportedFile" }
}
}
},
"MtrReport": {
"type": "object",
"required": ["mode", "target", "hops", "cyclesPlanned", "cyclesCompleted", "intervalMs"],
"properties": {
"mode": { "const": "mtr" },
"target": { "type": "string" },
"cyclesPlanned": {
"description": "Cycles requested via --cycles. `null` means unbounded (Ctrl+C).",
"oneOf": [{ "type": "integer", "minimum": 1 }, { "type": "null" }]
},
"cyclesCompleted": { "type": "integer", "minimum": 0 },
"intervalMs": { "type": "integer", "minimum": 0 },
"command": {
"type": "string",
"description": "Best-effort representation of the underlying traceroute command used for hop discovery."
},
"hops": {
"type": "array",
"items": { "$ref": "#/$defs/MtrHop" }
}
}
},
"Target": {
"type": "object",
"required": ["value", "source"],
"properties": {
"value": { "type": "string" },
"source": {
"type": "string",
"enum": ["argument", "csv", "cidr"]
},
"originalInput": { "type": "string" }
}
},
"ProbeResult": {
"type": "object",
"required": ["target", "source", "operation", "status", "summary", "command", "durationMs"],
"properties": {
"target": { "type": "string" },
"source": { "type": "string", "enum": ["argument", "csv", "cidr"] },
"operation": { "type": "string", "enum": ["ping", "trace"] },
"status": { "type": "string", "enum": ["completed", "failed"] },
"summary": { "type": "string" },
"command": { "type": "string" },
"durationMs": { "type": "integer", "minimum": 0 },
"rows": {
"type": "array",
"items": {
"oneOf": [
{ "$ref": "#/$defs/PingRow" },
{ "$ref": "#/$defs/TraceRow" }
]
}
}
}
},
"PingRow": {
"type": "object",
"required": ["seq", "status"],
"properties": {
"seq": { "type": ["integer", "string"] },
"bytes": { "type": ["integer", "null"] },
"ip": { "type": ["string", "null"] },
"ttl": { "type": ["integer", "null"] },
"timeMs": { "type": ["number", "null"] },
"privateDns": { "type": ["string", "null"] },
"publicDns": { "type": ["string", "null"] },
"org": { "type": ["string", "null"] },
"asn": { "type": ["string", "null"] },
"location": { "type": ["string", "null"] },
"netType": { "type": ["string", "null"] },
"policy": { "type": ["string", "null"] },
"status": { "type": "string" }
}
},
"TraceRow": {
"type": "object",
"required": ["hop", "status"],
"properties": {
"hop": { "type": ["integer", "string"] },
"host": { "type": ["string", "null"] },
"ip": { "type": ["string", "null"] },
"probe1Ms": { "type": ["number", "null"] },
"probe2Ms": { "type": ["number", "null"] },
"probe3Ms": { "type": ["number", "null"] },
"privateDns": { "type": ["string", "null"] },
"publicDns": { "type": ["string", "null"] },
"org": { "type": ["string", "null"] },
"asn": { "type": ["string", "null"] },
"location": { "type": ["string", "null"] },
"netType": { "type": ["string", "null"] },
"policy": { "type": ["string", "null"] },
"status": { "type": "string" }
}
},
"MtrHop": {
"type": "object",
"required": ["hop", "sent", "lost", "lossPercent"],
"properties": {
"hop": { "type": "integer", "minimum": 1 },
"ip": { "type": ["string", "null"] },
"ips": {
"type": "array",
"items": { "type": "string" },
"description": "Additional IPs observed at this hop across cycles (load-balanced paths)."
},
"host": { "type": ["string", "null"] },
"sent": { "type": "integer", "minimum": 0 },
"lost": { "type": "integer", "minimum": 0 },
"lossPercent": { "type": "number", "minimum": 0, "maximum": 100 },
"last": { "type": ["number", "null"] },
"best": { "type": ["number", "null"] },
"worst": { "type": ["number", "null"] },
"avg": { "type": ["number", "null"] },
"stdev": { "type": ["number", "null"] },
"privateDns": { "type": ["string", "null"] },
"publicDns": { "type": ["string", "null"] },
"org": { "type": ["string", "null"] },
"asn": { "type": ["string", "null"] },
"location": { "type": ["string", "null"] },
"netType": { "type": ["string", "null"] },
"policy": { "type": ["string", "null"] }
}
},
"ExportedFile": {
"type": "object",
"required": ["operation", "path", "rowCount"],
"properties": {
"operation": { "type": "string" },
"path": { "type": "string" },
"rowCount": { "type": "integer", "minimum": 0 }
}
}
}
}