Introduce new barectf configuration API and YAML configuration schema
[deliverable/barectf.git] / barectf / schemas / 3 / 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/3/config/config.json
26 title: Effective configuration object
27 definitions:
28 feature-uint-ft:
29 type: object
30 allOf:
31 - properties:
32 class:
33 enum:
34 - uint
35 - unsigned-int
36 - unsigned-integer
37 - uenum
38 - unsigned-enum
39 - unsigned-enumeration
40 - if:
41 properties:
42 class:
43 $ref: https://barectf.org/schemas/3/config/field-type.json#/definitions/uint-ft-class-prop
44 then:
45 $ref: https://barectf.org/schemas/3/config/field-type.json#/definitions/uint-ft
46 - if:
47 properties:
48 class:
49 $ref: https://barectf.org/schemas/3/config/field-type.json#/definitions/uenum-ft-class-prop
50 then:
51 $ref: https://barectf.org/schemas/3/config/field-type.json#/definitions/uenum-ft
52 opt-or-def-feature-uint-ft:
53 if:
54 type: object
55 then:
56 $ref: '#/definitions/feature-uint-ft'
57 else:
58 oneOf:
59 - type: boolean
60 - type: 'null'
61 opt-feature-uint-ft:
62 if:
63 type: object
64 then:
65 $ref: '#/definitions/feature-uint-ft'
66 else:
67 if:
68 type: boolean
69 then:
70 const: True
71 else:
72 type: 'null'
73 opt-struct-ft:
74 if:
75 type: object
76 then:
77 $ref: https://barectf.org/schemas/3/config/field-type.json#/definitions/struct-ft
78 else:
79 type: 'null'
80 trace:
81 title: Trace object
82 type: object
83 properties:
84 type:
85 $ref: '#/definitions/trace-type'
86 environment:
87 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-env-prop
88 required:
89 - type
90 trace-type:
91 title: Trace type object
92 type: object
93 properties:
94 uuid:
95 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-trace-type-uuid-prop
96 $default-byte-order:
97 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-byte-order-prop
98 $features:
99 if:
100 type: object
101 then:
102 properties:
103 magic-field-type:
104 allOf:
105 - $ref: '#/definitions/opt-or-def-feature-uint-ft'
106 - if:
107 type: object
108 then:
109 properties:
110 size:
111 const: 32
112 uuid-field-type:
113 if:
114 type: object
115 then:
116 allOf:
117 - $ref: https://barectf.org/schemas/3/config/field-type.json#/definitions/static-array-ft
118 - properties:
119 length:
120 const: 16
121 element-field-type:
122 allOf:
123 - $ref: '#/definitions/feature-uint-ft'
124 - properties:
125 size:
126 const: 8
127 alignment:
128 if:
129 type: integer
130 then:
131 const: 8
132 else:
133 if:
134 type: boolean
135 then:
136 const: false
137 else:
138 type: 'null'
139 stream-type-id-field-type:
140 $ref: '#/definitions/opt-or-def-feature-uint-ft'
141 additionalProperties: false
142 else:
143 type: 'null'
144 clock-types:
145 title: Clock types object
146 type: object
147 patternProperties:
148 '^[A-Za-z_][A-Za-z0-9_]*$':
149 $ref: '#/definitions/clock-type'
150 additionalProperties: false
151 stream-types:
152 title: Stream types object
153 type: object
154 patternProperties:
155 '^[A-Za-z_][A-Za-z0-9_]*$':
156 $ref: '#/definitions/stream-type'
157 additionalProperties: false
158 minProperties: 1
159 required:
160 - stream-types
161 additionalProperties: false
162 clock-type:
163 title: Clock type object
164 type: object
165 properties:
166 uuid:
167 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-uuid-prop
168 description:
169 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-string
170 frequency:
171 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-int-min-1
172 precision:
173 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-int-min-0
174 offset:
175 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-clock-type-offset-prop
176 origin-is-unix-epoch:
177 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-bool
178 $c-type:
179 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-string
180 additionalProperties: false
181 stream-type:
182 title: Stream type object
183 type: object
184 properties:
185 $is-default:
186 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-bool
187 $default-clock-type-name:
188 if:
189 type: string
190 then:
191 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/iden-prop
192 else:
193 type: 'null'
194 $features:
195 if:
196 type: object
197 then:
198 properties:
199 packet:
200 if:
201 type: object
202 then:
203 properties:
204 total-size-field-type:
205 $ref: '#/definitions/opt-feature-uint-ft'
206 content-size-field-type:
207 $ref: '#/definitions/opt-feature-uint-ft'
208 beginning-time-field-type:
209 $ref: '#/definitions/opt-or-def-feature-uint-ft'
210 end-time-field-type:
211 $ref: '#/definitions/opt-or-def-feature-uint-ft'
212 discarded-events-counter-field-type:
213 $ref: '#/definitions/opt-or-def-feature-uint-ft'
214 additionalProperties: false
215 else:
216 type: 'null'
217 event:
218 if:
219 type: object
220 then:
221 properties:
222 type-id-field-type:
223 $ref: '#/definitions/opt-or-def-feature-uint-ft'
224 time-field-type:
225 $ref: '#/definitions/opt-or-def-feature-uint-ft'
226 additionalProperties: false
227 else:
228 type: 'null'
229 additionalProperties: false
230 else:
231 type: 'null'
232 packet-context-field-type-extra-members:
233 if:
234 type: array
235 then:
236 $ref: https://barectf.org/schemas/3/config/field-type.json#/definitions/struct-ft-members
237 else:
238 type: 'null'
239 event-common-context-field-type:
240 $ref: '#/definitions/opt-struct-ft'
241 event-types:
242 title: Event types object
243 type: object
244 patternProperties:
245 '^[A-Za-z_][A-Za-z0-9_]*$':
246 $ref: '#/definitions/event-type'
247 additionalProperties: false
248 minProperties: 1
249 required:
250 - event-types
251 additionalProperties: false
252 event-type:
253 title: Event type object
254 type: object
255 properties:
256 log-level:
257 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/opt-int-min-0
258 specific-context-field-type:
259 $ref: '#/definitions/opt-struct-ft'
260 payload-field-type:
261 $ref: '#/definitions/opt-struct-ft'
262 additionalProperties: false
263 type: object
264 properties:
265 options:
266 title: Configuration options object
267 type: object
268 properties:
269 code-generation:
270 title: Code generation configuration options object
271 type: object
272 properties:
273 prefix:
274 if:
275 type: string
276 then:
277 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/config-prefix-prop
278 else:
279 type: object
280 properties:
281 identifier:
282 $ref: https://barectf.org/schemas/common/config/common.json#/definitions/iden-prop
283 file-name:
284 type: string
285 required:
286 - identifier
287 - file-name
288 additionalProperties: false
289 header:
290 title: Header code generation configuration options object
291 type: object
292 properties:
293 identifier-prefix-definition:
294 type: boolean
295 default-stream-type-name-definition:
296 type: boolean
297 additionalProperties: false
298 additionalProperties: false
299 additionalProperties: false
300 trace:
301 $ref: '#/definitions/trace'
302 required:
303 - trace
304 additionalProperties: false
This page took 0.036075 seconds and 4 git commands to generate.