-
Notifications
You must be signed in to change notification settings - Fork 5
/
publish-model.jsonnet
45 lines (38 loc) · 1.12 KB
/
publish-model.jsonnet
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
// Example publish-model file using jsonnet syntax.
// Note that there is an Intellij Idea jsonnet plugin, but it does not support formatting.
// For formatting, you can use the "jsonnetfmt" command line app.
// Import common function defined in another file
local utils = import '../utils.libsonnet';
{
subsystem: 'TEST',
component: 'jsonnet.example',
// comments can use // or #
publish: {
description: |||
Multi-line descriptions
use this syntax in jsonnet
|||,
events: [
// define two similar events using imported function
utils.commonEventFunc('myEvent1', 'param1', 'boolean'),
utils.commonEventFunc('myEvent2', 'param2', 'string'),
// Insert an imported event definition
utils.heartbeat,
// define another event
{
name: 'state',
// Import the description text
description: importstr '../importRaw.txt'
,
archive: false,
parameters: [
{
name: 'state',
description: 'Detector state',
enum: ['EXPOSING', 'READING', 'IDLE', 'ERROR'],
},
],
},
],
},
}