Introduce new barectf configuration API and YAML configuration schema
[deliverable/barectf.git] / barectf / schemas / 2 / config / config.yaml
1 # The MIT License (MIT)
2 #
3 # Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
4 #
5 # Permission is hereby granted, free of charge, to any person obtaining
6 # a copy of this software and associated documentation files (the
7 # "Software"), to deal in the Software without restriction, including
8 # without limitation the rights to use, copy, modify, merge, publish,
9 # distribute, sublicense, and/or sell copies of the Software, and to
10 # permit persons to whom the Software is furnished to do so, subject to
11 # the following conditions:
12 #
13 # The above copyright notice and this permission notice shall be
14 # included in all copies or substantial portions of the Software.
15 #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24 $schema: http://json-schema.org/draft-07/schema#
25 $id: https://barectf.org/schemas/2/config/config.json
26 title: Effective configuration object
27 definitions:
28 opt-struct-ft:
29 if:
30 type: object
31 then:
32 $ref: https://barectf.org/schemas/2/config/field-type.json#/definitions/struct-ft
33 else:
34 type: 'null'
35 uint-ft:
36 allOf:
37 - $ref: https://barectf.org/schemas/2/config/field-type.json#/definitions/int-ft
38 - properties:
39 signed:
40 const: false
41 uint-ft-ts:
42 allOf:
43 - $ref: '#/definitions/uint-ft'
44 - properties:
45 property-mappings:
46 type: array
47 required:
48 - property-mappings
49 packet-header-ft-prop:
50 allOf:
51 - $ref: '#/definitions/opt-struct-ft'
52 - if:
53 type: object
54 properties:
55 fields:
56 type: object
57 then:
58 properties:
59 fields:
60 properties:
61 magic:
62 allOf:
63 - $ref: '#/definitions/uint-ft'
64 - properties:
65 size:
66 const: 32
67 uuid:
68 allOf:
69 - $ref: https://barectf.org/schemas/2/config/field-type.json#/definitions/static-array-ft
70 - properties:
71 length:
72 const: 16
73 element-type:
74 allOf:
75 - $ref: https://barectf.org/schemas/2/config/field-type.json#/definitions/int-ft
76 - properties:
77 size:
78 const: 8
79 signed:
80 const: false
81 align:
82 enum:
83 - 1
84 - 2
85 - 4
86 - 8
87 stream_id:
88 $ref: '#/definitions/uint-ft'
89 stream_instance_id:
90 $ref: '#/definitions/uint-ft'
91 trace-type:
92 title: Trace type object
93 type: object
94 properties:
95 byte-order:
96 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/byte-order-prop
97 uuid:
98 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-trace-type-uuid-prop
99 packet-header-type:
100 $ref: '#/definitions/packet-header-ft-prop'
101 required:
102 - byte-order
103 additionalProperties: false
104 clock-type:
105 title: Clock type object
106 type: object
107 oneOf:
108 - required:
109 - $return-ctype
110 - required:
111 - return-ctype
112 - allOf:
113 - not:
114 required:
115 - $return-ctype
116 - not:
117 required:
118 - return-ctype
119 properties:
120 uuid:
121 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-uuid-prop
122 description:
123 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-string
124 freq:
125 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-int-min-1
126 error-cycles:
127 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-int-min-0
128 offset:
129 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-clock-type-offset-prop
130 absolute:
131 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-bool
132 return-ctype:
133 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-string
134 $return-ctype:
135 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-string
136 additionalProperties: false
137 $default-stream:
138 if:
139 type: string
140 then:
141 pattern: '^[A-Za-z_][A-Za-z0-9_]*$'
142 else:
143 type: 'null'
144 packet-context-ft-prop:
145 allOf:
146 - $ref: https://barectf.org/schemas/2/config/field-type.json#/definitions/struct-ft
147 - properties:
148 fields:
149 properties:
150 packet_size:
151 $ref: '#/definitions/uint-ft'
152 content_size:
153 $ref: '#/definitions/uint-ft'
154 events_discarded:
155 $ref: '#/definitions/uint-ft'
156 packet_seq_num:
157 $ref: '#/definitions/uint-ft'
158 timestamp_begin:
159 $ref: '#/definitions/uint-ft-ts'
160 timestamp_end:
161 $ref: '#/definitions/uint-ft-ts'
162 required:
163 - packet_size
164 - content_size
165 dependencies:
166 timestamp_begin:
167 - timestamp_end
168 timestamp_end:
169 - timestamp_begin
170 required:
171 - fields
172 event-header-ft-prop:
173 allOf:
174 - $ref: '#/definitions/opt-struct-ft'
175 - if:
176 type: object
177 properties:
178 fields:
179 type: object
180 then:
181 properties:
182 fields:
183 properties:
184 id:
185 $ref: '#/definitions/uint-ft'
186 timestamp:
187 $ref: '#/definitions/uint-ft-ts'
188 stream-type:
189 title: Stream type object
190 type: object
191 properties:
192 $default:
193 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-bool
194 packet-context-type:
195 $ref: '#/definitions/packet-context-ft-prop'
196 event-header-type:
197 $ref: '#/definitions/event-header-ft-prop'
198 event-context-type:
199 $ref: '#/definitions/opt-struct-ft'
200 events:
201 title: Event types object
202 type: object
203 patternProperties:
204 '^[A-Za-z_][A-Za-z0-9_]*$':
205 $ref: '#/definitions/event-type'
206 additionalProperties: false
207 minProperties: 1
208 required:
209 - packet-context-type
210 - events
211 additionalProperties: false
212 event-type:
213 title: Event type object
214 type: object
215 properties:
216 log-level:
217 if:
218 type: integer
219 then:
220 minimum: 0
221 else:
222 oneOf:
223 - type: string
224 - type: 'null'
225 context-type:
226 $ref: '#/definitions/opt-struct-ft'
227 payload-type:
228 $ref: '#/definitions/opt-struct-ft'
229 additionalProperties: false
230 type: object
231 properties:
232 version:
233 type: string
234 enum:
235 - '2.0'
236 - '2.1'
237 - '2.2'
238 prefix:
239 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/config-prefix-prop
240 options:
241 title: Configuration options object
242 type: object
243 properties:
244 gen-prefix-def:
245 type: boolean
246 gen-default-stream-def:
247 type: boolean
248 additionalProperties: false
249 metadata:
250 title: Metadata object
251 type: object
252 oneOf:
253 - required:
254 - $log-levels
255 - required:
256 - log-levels
257 - allOf:
258 - not:
259 required:
260 - $log-levels
261 - not:
262 required:
263 - log-levels
264 properties:
265 log-levels:
266 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-log-level-aliases-prop
267 $log-levels:
268 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-log-level-aliases-prop
269 trace:
270 $ref: '#/definitions/trace-type'
271 env:
272 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-env-prop
273 clocks:
274 title: Clock types object
275 type: object
276 patternProperties:
277 '^[A-Za-z_][A-Za-z0-9_]*$':
278 $ref: '#/definitions/clock-type'
279 additionalProperties: false
280 $default-stream:
281 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-string
282 streams:
283 title: Stream types object
284 type: object
285 patternProperties:
286 '^[A-Za-z_][A-Za-z0-9_]*$':
287 $ref: '#/definitions/stream-type'
288 additionalProperties: false
289 minProperties: 1
290 required:
291 - trace
292 - streams
293 additionalProperties: false
294 required:
295 - version
296 - metadata
297 additionalProperties: false
This page took 0.034638 seconds and 4 git commands to generate.